2016-11-07 230 views
0

我想部署一個使用web runner的web應用程序,但是tomcat正在拋出以下錯誤。 請讓我知道可能是什麼問題。Tomcat服務器無法啓動

$ java -jar target/dependency/webapp-runner.jar target/*.war 
    Nov 07, 2016 8:53:34 AM org.apache.catalina.startup.ExpandWar expand 
    INFO: An expanded directory [/Users/pratiksanglikar/Documents/CMPE- 281/workspace/cmpe281-pratik021-hw3-extra- credit/target/tomcat.8080/webapps/expanded] was found with a last modified time that did not match the associated WAR. It will be deleted. 
    Expanding cmpe281-pratik021-hw3-extra-credit.war into /Users/pratiksanglikar/Documents/CMPE-281/workspace/cmpe281-pratik021-hw3-extra-credit/target/tomcat.8080/webapps/expanded 
    Adding Context for /Users/pratiksanglikar/Documents/CMPE-281/workspace/cmpe281-pratik021-hw3-extra-credit/target/tomcat.8080/webapps/expanded 
    Nov 07, 2016 8:53:35 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-nio-8080"] 
    Nov 07, 2016 8:53:35 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 
    INFO: Using a shared selector for servlet write/read 
Nov 07, 2016 8:53:35 AM org.apache.catalina.core.StandardService startInternal 
    INFO: Starting service Tomcat 
Nov 07, 2016 8:53:35 AM org.apache.catalina.core.StandardEngine startInternal 
    INFO: Starting Servlet Engine: Apache Tomcat/8.0.30 
Nov 07, 2016 8:53:35 AM org.apache.catalina.core.ContainerBase startInternal 
    SEVERE: A child container failed during start 
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] 
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) 
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) 
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 
    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 [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    ... 6 more 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [[email protected]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4928) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 6 more 
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [[email protected]] 
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) 
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 9 more 
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature) 
    at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96) 
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) 
    ... 12 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.JarResourceSet.initInternal(JarResourceSet.java:94) 
    ... 13 more 

Nov 07, 2016 8:53:35 AM org.apache.catalina.core.ContainerBase startInternal 
SEVERE: A child container failed during start 
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]] 
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) 
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) 
    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:150) 
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:344) 
    at webapp.runner.launch.Main.main(Main.java:261) 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 
    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: A child container failed during start 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924) 
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 6 more 

Exception in thread "main" org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:344) 
    at webapp.runner.launch.Main.main(Main.java:261) 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 2 more 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 4 more 
Caused by: org.apache.catalina.LifecycleException: A child container failed during start 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924) 
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    ... 6 more 

相同的代碼不工作時,我雖然在Heroku上部署它.. 我要測試本地機器上的代碼,然後它無法執行。

回答

1

java.util.zip.ZipException: invalid LOC header表示您的ZIP文件已損壞。既然它是在談論重新榨取你的戰爭,它看起來像你複製到它的戰爭文件有問題。

在附註中,對於新的Spring項目,只需使用Spring Boot - 它將爲您處理容器並完全消除戰爭和容器配置。

相關問題