[急]tomcat 启动报错

iFlyS 发布于 2014/11/17 15:30
阅读 9K+
收藏 0

今天发布war时启动服务器时,发现服务器报以下错误:

SEVERE: Exception fixing docBase for context [/sjfx]
java.util.zip.ZipException: error in opening zip file
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(Unknown Source)
 at java.util.zip.ZipFile.<init>(Unknown Source)
 at java.util.jar.JarFile.<init>(Unknown Source)
 at java.util.jar.JarFile.<init>(Unknown Source)
 at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
 at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
 at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
 at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
 at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
 at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:111)
 at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:722)
 at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:850)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
 at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

十一月 17, 2014 10:53:44 上午 org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : error in opening zip file
 at org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:136)
 at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5089)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

十一月 17, 2014 10:53:44 上午 org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sjfx]]
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Error in resourceStart()
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5270)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 ... 11 more

十一月 17, 2014 10:53:44 上午 org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive C:\Tomcat7\webapps\sjfx.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sjfx]]
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

上网搜索相关Exception, 大部分的说法是: zip包存在问题,数据错误,所以导致打开zip的时候报Exception。但是我把jar包给解压出来搜.zip项目里根本就没有.zip文件。所以再次请教社区的大神们,这到底是怎么回事啊。其实这个项目在自己的电脑上是可以运行的打包到服务器上之后运行就会报错,我和服务器上的tomcat不一样我的是6服务器上是7;MySQL是服务器是5.2我的是5.1 兼容肯定是能兼容我的项目的啊 

加载中
0
moz1q1
moz1q1
简单,就换成服务器的配置就可以,别纠结这个版本问题
iFlyS
iFlyS
问题已经解决了,谢谢你的评论
0
y
yijio
怎么解决的》?
0
小宋
小宋
.....怎么解决的,我也遇到这个问题了
0
小宋
小宋
这个问题我已经知道是怎么回事了,我这边的原因是因为在上传war的过程中,war还没有上传完,tomcat就开始解压war了,所有等到war上传完,就不会再报这个错误了
0
iFlyS
iFlyS

没想到啊这次又出现了这个问题,搜了一下文章竟然是自己发布的- - ,这次问题的原因是有人在服务器的项目上放了一些没用的图片,,,关键还是这几张图片还乱码了,,然后打包出来的war就不能正常运行,,,,,,,,这种问题一般都是代码的问题,如果遇到请尝试更新代码删掉没用的文件就可以运行了

返回顶部
顶部