开发者社区> 问答> 正文

[急]tomcat 启动报错?报错

今天发布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 兼容肯定是能兼容我的项目的啊 

展开
收起
爱吃鱼的程序员 2020-06-14 20:12:53 602 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    简单,就换成服务器的配置就可以,别纠结这个版本问题问题已经解决了,谢谢你的评论怎么解决的》?.....怎么解决的,我也遇到这个问题了这个问题我已经知道是怎么回事了,我这边的原因是因为在上传war的过程中,war还没有上传完,tomcat就开始解压war了,所有等到war上传完,就不会再报这个错误了回复<aclass="referer"target="_blank">@zb82875530:没办法,要么就停掉tomcat,上传完了,再启动你好,请问怎么让他上传完再解压?麻烦能告知一下吗?这个问题困扰很久了

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

    2020-06-14 20:13:11
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载