关于我的eclipse的老毛病的解决方案
先来一段困扰我多年(长达三个月)的错误报告:
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server.服务器版本: Apache Tomcat/9.0.27
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 服务器构建: Oct 7 2019 09:57:22 UTC
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version number: 9.0.27.0
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS.版本: 10.0
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 架构: amd64
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java 环境变量: D:\eclipse\Java\jdk-13.0.1
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM 版本: 13.0.1+9
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM.供应商: Oracle Corporation
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\eclipse\Eclipse\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\Tomcat\apache-tomcat-9.0.27
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\eclipse\Eclipse\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\Tomcat\apache-tomcat-9.0.27
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\eclipse\Eclipse\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
2月 18, 2020 3:43:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
2月 18, 2020 3:43:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0].
2月 18, 2020 3:43:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2月 18, 2020 3:43:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
2月 18, 2020 3:43:34 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized [OpenSSL 1.1.1c 28 May 2019]
2月 18, 2020 3:43:34 下午 org.apache.coyote.AbstractProtocol init
信息: 初始化协议处理器 ["http-nio-8080"]
2月 18, 2020 3:43:38 下午 org.apache.coyote.AbstractProtocol init
信息: 初始化协议处理器 ["ajp-nio-8009"]
2月 18, 2020 3:43:38 下午 org.apache.catalina.startup.Catalina load
信息: 服务器在[4,582]毫秒内初始化
2月 18, 2020 3:43:38 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
2月 18, 2020 3:43:38 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet engine: [Apache Tomcat/9.0.27]
2月 18, 2020 3:43:40 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,805] milliseconds.
2月 18, 2020 3:43:41 下午 org.apache.catalina.core.ContainerBase startInternal
严重: 子容器启动失败
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 21 more
Caused by: java.lang.IllegalArgumentException: 名为 [exam.servlet.AddcheSer]和 [exam.servlet.AdddepSer] 的servlet不能映射为一个url模式(url-pattern) [/AdddepSer]
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:342)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:335)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2459)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2135)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2124)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2016)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1233)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1142)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5051)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more
2月 18, 2020 3:43:41 下午 org.apache.catalina.core.ContainerBase startInternal
严重: 子容器启动失败
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 子容器启动失败
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.apache.catalina.LifecycleException: 子容器启动失败
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 13 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 21 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 21 more
Caused by: java.lang.IllegalArgumentException: 名为 [exam.servlet.AddcheSer]和 [exam.servlet.AdddepSer] 的servlet不能映射为一个url模式(url-pattern) [/AdddepSer]
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:342)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:335)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2459)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2135)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2124)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2016)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1233)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1142)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5051)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more
2月 18, 2020 3:43:41 下午 org.apache.catalina.startup.Catalina start
严重: 所必需的服务组件启动失败,所以无法启动Tomcat
org.apache.catalina.LifecycleException: 子容器启动失败
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 子容器启动失败
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 13 more
Caused by: org.apache.catalina.LifecycleException: 子容器启动失败
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 13 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
... 21 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JavaFinalExam]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
... 21 more
Caused by: java.lang.IllegalArgumentException: 名为 [exam.servlet.AddcheSer]和 [exam.servlet.AdddepSer] 的servlet不能映射为一个url模式(url-pattern) [/AdddepSer]
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:342)
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:335)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2459)
at org.apache.catalina.startup.ContextConfig.processClass(ContextConfig.java:2135)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2124)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2016)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:2010)
at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1233)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1142)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5051)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more
2月 18, 2020 3:43:41 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-nio-8080"]
2月 18, 2020 3:43:41 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["ajp-nio-8009"]
2月 18, 2020 3:43:41 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service [Catalina]
2月 18, 2020 3:43:41 下午 org.apache.coyote.AbstractProtocol destroy
信息: 正在摧毁协议处理器 ["http-nio-8080"]
2月 18, 2020 3:43:41 下午 org.apache.coyote.AbstractProtocol destroy
信息: 正在摧毁协议处理器 ["ajp-nio-8009"]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/D:/Tomcat/apache-tomcat-9.0.27/lib/catalina.jar) to field java.io.ObjectStreamClass$Caches.localDescs
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release。
在上学期的结课考试时,这个问题就开始了,之后查了很多资料,做了很多种方案的修缮都没有得到有效的解决。
然后,今天尝试边整理,边修复的方式,解决这个问题。
首先,我看到在控制台的最后五行是飘红的warning(以上也是),那么这五行是什么意思呢?我参考谷歌翻译查到了以下结果:
最主要的问题是第一行的"An illegal reflective access operation has occurred",进行了非法反射访问。
之后我又查了什么是非法反射访问,以下是查到的园友博客链接。
https://blog.csdn.net/leyuuu/article/details/100917769
大致意思就是说,JDK9+对一些API进行了调整,但是老版本的软件运行还是会调用这些API,官方不建议这么做然后给出警告。
解决方法也是将对应的api进行升级或替换。
Let me have a try!
我的jdk应该是11版本的。但是还不太清楚。
查看jdk版本https://jingyan.baidu.com/article/20095761080c8dcb0621b478.html
然后我找到了我的安装文件
是13.0.1版本,我还打开了对应的bin文件
怎么找那个版本过低的api呢?
我又仔细研究了错误报告,发现从这里开始出错。
我又查了子容器启动失败的解决方案,
https://blog.csdn.net/qq_38839887/article/details/97573134
我的tomcat就是9.0,
Java也是1.8。
所以,我决定按这个修改一下。
列表不同,找到的那个也没有错。。。
重启也还是不管用。
然后我打开了org.eclipse.jdt.core.prefs文件。
和那位博主的resource文件只多了两行disabled以及warning。
我准备删除这几行,再次进行尝试。
完全没有作用。
还是升级api好了。
我要把我的错误报告放到csdn上,请大神指点迷津啊。
今天还是没能解决这个问题。
本文来自博客园,作者:ayyue,转载请注明原文链接:https://www.cnblogs.com/aiyyue/p/12326802.html