我收到这个 Tomcat 错误

Posted

技术标签:

【中文标题】我收到这个 Tomcat 错误【英文标题】:I'm getting this Tomcat error 【发布时间】:2018-06-14 03:14:02 【问题描述】:

 SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@269f4bad]
        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:947)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
        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:941)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
        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:564)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
    Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@269f4bad]
        at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
        at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
        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:941)
        ... 21 more
    Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
        at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:114)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
        ... 33 more
    Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
        at java.base/java.util.zip.ZipFile$ZipFileInputStream.initDataOffset(ZipFile.java:751)
        at java.base/java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:761)
        at java.base/java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:407)
        at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:159)
        at java.base/java.io.InputStream.readNBytes(InputStream.java:309)
        at java.base/java.util.jar.JarFile.getBytes(JarFile.java:768)
        at java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:397)
        at java.base/java.util.jar.JarFile.getManifest(JarFile.java:384)
        at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:112)
        ... 34 more

    Jan 04, 2018 5:01:21 PM org.apache.catalina.core.ContainerBase startInternal
    SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
        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:947)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
        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:564)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
        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:941)
        ... 13 more

    Jan 04, 2018 5:01:21 PM org.apache.catalina.startup.Catalina start
    SEVERE: The required Server component failed to start so Tomcat is unable to start.
    org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
        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:564)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

    Jan 04, 2018 5:01:21 PM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["http-nio-8080"]
    Jan 04, 2018 5:01:21 PM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["ajp-nio-8009"]
    Jan 04, 2018 5:01:21 PM org.apache.catalina.core.StandardService stopInternal
    INFO: Stopping service [Catalina]
    Jan 04, 2018 5:01:21 PM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["http-nio-8080"]
    Jan 04, 2018 5:01:21 PM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["ajp-nio-8009"]
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/E:/Apache/apache-tomcat-9.0.1-windows-x64/apache-tomcat-9.0.1/lib/catalina.jar) to field java.lang.Thread.threadLocals
    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

好吧,我尝试重新启动服务器,删除服务器,甚至重新安装服务器。我什至重新安装了整个 TomCat,但它仍然无法正常工作。我什至删除了maven项目并重新编写了它。仍然向我显示相同的错误。 有谁知道这个错误的根源在哪里? 我正在使用 Eclipse Oxygen 2.0 和 Tomcat 9.0.1 和 JDK 9。 我的选择已经不多了,我一个月前才开始学习 maven。

【问题讨论】:

您需要提供屏幕截图和/或控制台中的“详细信息”。 查看日志文件 .... 发布相关代码以及问题描述/堆栈跟踪。 【参考方案1】:

日志文件中的堆栈跟踪表明您的 EAR、WAR、JAR 或 ZIP 文件已损坏。 (EAR、WAR 和 JAR 文件实际上只是具有特殊命名结构的 ZIP 文件......)

这很可能是您的 web 应用程序(例如,您构建或部署它的方式)而不是 Tomcat 的问题。

【讨论】:

以上是关于我收到这个 Tomcat 错误的主要内容,如果未能解决你的问题,请参考以下文章

tomcat 日志文件中的异常

tomcat 6的问题

如果前端 Tomcat 被杀死,C++ 服务器将终止。错误“收到未捕获的信号 [13] - SIGPIPE”

如何使用 Tomcat 在本地产生 503 错误?

为啥Tomcat版本9.0.44返回错误503

TomcatJPS中常见的tomcat报错错误分析