导入Icake源码,登陆出错。InvocationTargetException
"D:\Tomcat 8.5\bin\catalina.bat" run [2019-11-03 03:06:06,486] Artifact icake:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2" Using CATALINA_HOME: "D:\Tomcat 8.5" Using CATALINA_TMPDIR: "D:\Tomcat 8.5\temp" Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_201" Using CLASSPATH: "D:\Tomcat 8.5\bin\bootstrap.jar;D:\Tomcat 8.5\bin\tomcat-juli.jar" 03-Nov-2019 15:06:07.938 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.45 03-Nov-2019 15:06:07.941 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 14 2019 22:21:25 UTC 03-Nov-2019 15:06:07.941 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.45.0 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_201\jre 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_201-b09 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2 03-Nov-2019 15:06:07.942 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Tomcat 8.5 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2\conf\logging.properties 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 03-Nov-2019 15:06:07.943 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2\jmxremote.password 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2\jmxremote.access 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 03-Nov-2019 15:06:07.944 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2019.2\system\tomcat\Unnamed_icake_2 03-Nov-2019 15:06:07.945 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Tomcat 8.5 03-Nov-2019 15:06:07.945 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Tomcat 8.5\temp 03-Nov-2019 15:06:07.945 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_201\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Xshell\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Java\jdk-10\bin;C:\Program Files\Java\jdk1.8.0_201\bin;C:\Program Files\Java\jdk1.8.0_201\jre\bin;D:\apache-maven-3.6.2\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;D:\IntelliJ IDEA 2019.2.3\bin;;.] 03-Nov-2019 15:06:08.114 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 03-Nov-2019 15:06:08.175 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 03-Nov-2019 15:06:08.338 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"] 03-Nov-2019 15:06:08.344 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 03-Nov-2019 15:06:08.344 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 984 ms 03-Nov-2019 15:06:08.403 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 03-Nov-2019 15:06:08.403 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.45 03-Nov-2019 15:06:08.418 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 03-Nov-2019 15:06:08.430 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 03-Nov-2019 15:06:08.433 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 88 ms Connected to server [2019-11-03 03:06:08,830] Artifact icake:war exploded: Artifact is being deployed, please wait... 03-Nov-2019 15:06:10.806 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. [2019-11-03 03:06:12,305] Artifact icake:war exploded: Artifact is deployed successfully [2019-11-03 03:06:12,306] Artifact icake:war exploded: Deploy took 3,476 milliseconds 03-Nov-2019 15:06:18.425 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Tomcat 8.5\webapps\manager] 03-Nov-2019 15:06:18.590 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Tomcat 8.5\webapps\manager] has finished in [164] ms java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.imooc.icake.global.GlobalController.service(GlobalController.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.imooc.icake.global.EncodingFilter.doFilter(EncodingFilter.java:22) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:542) at java.lang.Integer.parseInt(Integer.java:615) at com.imooc.icake.controller.DefaultController.detail(DefaultController.java:69) ... 30 more
错误日志信息。
7
收起
正在回答
1回答
同学你好。从报错信息可以看到,真正的报错是DefaultController中的detail方法里,parseInt时出现了空指针异常:
那么去代码中寻找,可以看到这里parseInt的参数是直接从request中直接获取的参数,也就是在请求的时候,不能只使用“http://localhost:8080/detail.do”,应该在后面带上id呢~
如果解答了同学的疑问,望采纳~
祝学习愉快~
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星