我在下面得到了这个奇怪的例外:
INFO: Deploying web application archive ZangV3Spring.war
10-Sep-2010 08:46:38 org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase for context [/ZangV3Spring]
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:80)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:110)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:709)
at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:838)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:331)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:312)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:292)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:129)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:785)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:763)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1458)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:338)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1186)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1340)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1349)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1329)
at java.lang.Thread.run(Thread.java:619)
10-Sep-2010 08:46:38 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:141)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4432)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4582)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:785)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:763)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1458)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:338)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1186)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1340)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1349)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1329)
at java.lang.Thread.run(Thread.java:619)
如果我从我的xml中删除这个bean,它将构建并部署find:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
</bean>
我的xml内容的其余部分是:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
<!-- http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd -->
<!-- Config properties files -->
<!-- Hibernate database stuff -->
<bean id="fileDownload" class="com.kc.models.FileManipulator"></bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>properties/jdbc.properties</value>
</list>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${database.driver}" />
<property name="url" value="${database.url}" />
<property name="username" value="${database.user}" />
<property name="password" value="${database.password}" />
<property name="maxActive" value="${database.maxConnections}" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
</bean>
<!--
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionsFactory" ref="sessionFactory"></property>
</bean>
-->
</beans>
答案 0 :(得分:1)
当tomcat6在错误的位置查找war文件时,我遇到了同样的错误。恕我直言,非常误导性的错误消息。将配置更改为指向正确的位置并且工作正常。
答案 1 :(得分:0)
您的war文件似乎已损坏。尝试重新创建它。并尝试使用zip程序(如winrar)打开它
答案 2 :(得分:0)
有相同的erorr,但它在日志中的第二个错误,第一个:
严重:异常修复docBase for context [/ readfromnet] java.util.zip.ZipException:打开zip文件时出错
所以,我认为Tomcat在完全上传之前开始解压缩
答案 3 :(得分:0)
清除所有.jar关联项目,然后自动构建它们。现在你可以启动jboss服务器来解决你的问题。这在我的结束时解决了。
答案 4 :(得分:0)
是的,.war文件我被破坏了......或者你可能只需要更改它的权限。我也碰到了这个。幸运的是,我正在升级,并将旧的.war文件与之比较。
旧的-rw-r-r--和新的-rw-r -----。快点:
$ sudo chmod 644 <filename>.war
修正了它。