一切正常,直到我从Workspaces删除这个项目以加载和编辑另一个项目,当我重新加载前一个项目时,它无法在Tomcat上启动。我没有更改web.xml和其他文件的任何内容,我在网上尝试了几个现有的解决方案,但都失败了:
确保MyEclipse和Tomcat的Java版本相同。
尝试删除Tomcat,然后重新部署项目。
检查web.xml(我之前没有更改,但之前它正常工作)。
删除整个Workspaces目录并重新启动项目。
这是登录控制台的一部分:
信息: Deploying web application directory /Users/haohui/Downloads/apache-tomcat-8.0.41/webapps/ROOT
二月 18, 2017 1:02:38 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory /Users/haohui/Downloads/apache-tomcat-8.0.41/webapps/ROOT has finished in 14 ms
二月 18, 2017 1:02:38 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory /Users/haohui/Downloads/apache-tomcat-8.0.41/webapps/v3
二月 18, 2017 1:02:38 下午 org.apache.catalina.core.ContainerBase addChildInternal
严重: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/v3]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@182cfd14]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4969)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@2dccbd5e]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:135)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:706)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:113)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 16 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readFully(IOUtils.java:65)
at java.util.jar.JarFile.getBytes(JarFile.java:425)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:111)
... 17 more
二月 18, 2017 1:02:38 下午 org.apache.catalina.startup.HostConfig deployDirectory
严重: Error deploying web application directory /Users/haohui/Downloads/apache-tomcat-8.0.41/webapps/v3
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/v3]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:757)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
二月 18, 2017 1:02:38 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory /Users/haohui/Downloads/apache-tomcat-8.0.41/webapps/v3 has finished in 28 ms
二月 18, 2017 1:02:38 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
二月 18, 2017 1:02:38 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
二月 18, 2017 1:02:38 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 711 ms
答案 0 :(得分:1)
这可能与Eclipse / Tomcat无关,它应该是项目中损坏的jar依赖项。请参阅:tomcat server fails to start the server and application in STS
也许你没有搜索好的关键词:" LOC标题无效(签名错误)"