使用jdk1.5运行时为什么jetty-runner-7.6.jar失败并出现java.lang.IllegalStateException:zip文件已关闭?

时间:2013-08-17 15:30:37

标签: deployment jetty zipfile jdk1.5

我无法在Ubuntu 13(JDK 1.5)和HP-UX 11.23(使用JDK 1.5)上的jetty runner 7.6上部署.war,我这样运行:

/opt/java1.5/bin/java -classpath jetty-runner-7.6.jar \
                      org.mortbay.jetty.runner.Runner MyWar.war

我收到此错误:

20XX-XX-XX ##:10:07.233:INFO:omjr.Runner:Runner
20XX-XX-XX ##:10:07.235:WARN:omjr.Runner:No tx manager found
20XX-XX-XX ##:10:07.396:INFO:omjr.Runner:Deploying file:/home/myuser/MyWar.war @ /
20XX-XX-XX ##:10:07.472:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
20XX-XX-XX ##:10:07.599:INFO:oejw.WebInfConfiguration:Extract jar:file:/home/myuser/MyWar.war!/ to /var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp
20XX-XX-XX ##:10:08.740:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp/},file:/home/myuser/MyWar.war java.lang.IllegalStateException: zip file closed

如果我使用JDK 1.6,它可以在Ubuntu和HP-UX中使用。

我找到了一种让使用JDK 1.5 的方法:我“爆炸”将jetty-runner的.jar放入文件夹并执行它:

/opt/java1.5/bin/java -classpath jetty-runner-7.6 \
                      org.mortbay.jetty.runner.Runner MyWar.war

我从http://mvnrepository.com/artifact/org.mortbay.jetty/jetty-runner/7.6.12.v20130726得到的jetty-runner-7.6.jar似乎与java.util.zip.ZipFile存在某种兼容性问题。我尝试用7-zip再次压缩它,但是没有修复失败..其他人有这个问题吗?

这是完整的堆栈跟踪:

20XX-XX-XX ##:10:07.233:INFO:omjr.Runner:Runner 
20XX-XX-XX ##:10:07.235:WARN:omjr.Runner:No tx manager found 
20XX-XX-XX ##:10:07.396:INFO:omjr.Runner:Deploying file:/home/myuser/MyWar.war @ / 
20XX-XX-XX ##:10:07.472:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT 
20XX-XX-XX ##:10:07.599:INFO:oejw.WebInfConfiguration:Extract jar:file:/home/myuser/MyWar.war!/ to /var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp
20XX-XX-XX ##:10:08.740:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp/},file:/home/myuser/MyWar.war java.lang.IllegalStateException: zip file closed
            at java.util.zip.ZipFile.ensureOpen(ZipFile.java:535)
            at java.util.zip.ZipFile.getEntry(ZipFile.java:268)
            at java.util.jar.JarFile.getEntry(JarFile.java:200)
            at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)
            at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)
            at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
            at java.net.URL.openStream(URL.java:1007)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(VersionHelper12.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(VersionHelper12.java:190)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(VersionHelper12.java:210)
            at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:470)
            at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
            at javax.naming.InitialContext.init(InitialContext.java:219)
            at javax.naming.InitialContext.<init>(InitialContext.java:175)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.createEnvContext(EnvConfiguration.java:256)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.preConfigure(EnvConfiguration.java:72)
            at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:445)
            at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:481) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
            at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
            at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
            at org.eclipse.jetty.server.Server.doStart(Server.java:281)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
            at org.mortbay.jetty.runner.Runner.run(Runner.java:511)
            at org.mortbay.jetty.runner.Runner.main(Runner.java:632) 
20XX-XX-XX ##:10:08.747:WARN:oejsh.RequestLogHandler:!RequestLog 
20XX-XX-XX ##:10:08.824:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 ^C
20XX-XX-XX ##:13:20.301:INFO:oejsh.ContextHandler:stopped o.e.j.w.WebAppContext{/,file:/var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp/},file:/home/myuser/MyWar.war 
20XX-XX-XX ##:13:20.303:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/,file:/var/tmp/jetty-0.0.0.0-8080-MyWar.war-_-any-/webapp/},file:/home/myuser/MyWar.war: java.lang.IllegalStateException: zip file closed java.lang.IllegalStateException: zip file closed
            at java.util.zip.ZipFile.ensureOpen(ZipFile.java:535)
            at java.util.zip.ZipFile.getEntry(ZipFile.java:268)
            at java.util.jar.JarFile.getEntry(JarFile.java:200)
            at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)
            at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)
            at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
            at java.net.URL.openStream(URL.java:1007)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(VersionHelper12.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(VersionHelper12.java:190)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(VersionHelper12.java:210)
            at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:470)
            at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
            at javax.naming.InitialContext.init(InitialContext.java:219)
            at javax.naming.InitialContext.<init>(InitialContext.java:175)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.deconfigure(EnvConfiguration.java:152)
            at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:511)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107)
            at org.eclipse.jetty.server.Server.doStop(Server.java:342)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:132) 
20XX-XX-XX ##:13:20.306:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.handler.ContextHandlerCollection@1c0ec97: java.lang.IllegalStateException: zip file closed java.lang.IllegalStateException: zip file closed
            at java.util.zip.ZipFile.ensureOpen(ZipFile.java:535)
            at java.util.zip.ZipFile.getEntry(ZipFile.java:268)
            at java.util.jar.JarFile.getEntry(JarFile.java:200)
            at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)
            at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)
            at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
            at java.net.URL.openStream(URL.java:1007)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(VersionHelper12.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(VersionHelper12.java:190)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(VersionHelper12.java:210)
            at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:470)
            at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
            at javax.naming.InitialContext.init(InitialContext.java:219)
            at javax.naming.InitialContext.<init>(InitialContext.java:175)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.deconfigure(EnvConfiguration.java:152)
            at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:511)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107)
            at org.eclipse.jetty.server.Server.doStop(Server.java:342)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:132)
20XX-XX-XX ##:13:20.309:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.handler.HandlerCollection@ecb281: java.lang.IllegalStateException: zip file closed java.lang.IllegalStateException: zip file closed
            at java.util.zip.ZipFile.ensureOpen(ZipFile.java:535)
            at java.util.zip.ZipFile.getEntry(ZipFile.java:268)
            at java.util.jar.JarFile.getEntry(JarFile.java:200)
            at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)
            at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)
            at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
            at java.net.URL.openStream(URL.java:1007)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(VersionHelper12.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(VersionHelper12.java:190)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(VersionHelper12.java:210)
            at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:470)
            at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
            at javax.naming.InitialContext.init(InitialContext.java:219)
            at javax.naming.InitialContext.<init>(InitialContext.java:175)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.deconfigure(EnvConfiguration.java:152)
            at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:511)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107)
            at org.eclipse.jetty.server.Server.doStop(Server.java:342)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:132)
20XX-XX-XX ##:13:20.312:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@1bb60c3: java.lang.IllegalStateException: zip file closed java.lang.IllegalStateException: zip file closed
            at java.util.zip.ZipFile.ensureOpen(ZipFile.java:535)
            at java.util.zip.ZipFile.getEntry(ZipFile.java:268)
            at java.util.jar.JarFile.getEntry(JarFile.java:200)
            at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)
            at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)
            at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
            at java.net.URL.openStream(URL.java:1007)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(VersionHelper12.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(VersionHelper12.java:190)
            at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(VersionHelper12.java:210)
            at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:470)
            at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
            at javax.naming.InitialContext.init(InitialContext.java:219)
            at javax.naming.InitialContext.<init>(InitialContext.java:175)
            at org.eclipse.jetty.plus.webapp.EnvConfiguration.deconfigure(EnvConfiguration.java:152)
            at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:511)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:250)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:107)
            at org.eclipse.jetty.server.Server.doStop(Server.java:342)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
            at org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:132)

0 个答案:

没有答案