部署 WAR 文件时出现 tomcat 错误 [英] tomcat error while deploying WAR file

查看:53
本文介绍了部署 WAR 文件时出现 tomcat 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我解决以下在尝试在 Tomcat 服务器上部署 WAR 文件时获得的异常.

Please help me with the below exceptions that I obtain while trying to deploy a WAR file on Tomcat server.

07:46:50,076  WARN HostConfig:606 - Exception while expanding web application archive chapal.war
07:47:00,123  INFO StandardHostDeployer:435 - Processing Context configuration file URL file:/home/eqdev/eqgen117/chrad/chapal-puru/tomcat/conf/Catalina/local
host/chapal.xml
07:47:00,158 ERROR Digester:1275 - Begin event threw exception
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:203)
        at java.util.jar.JarFile.<init>(JarFile.java:132)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:56)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:41)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:102)
        at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:69)
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:155)
        at org.apache.catalina.startup.SetDocBaseRule.begin(SetDocBaseRule.java:138)
        at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
        at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1567)
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
        at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:834)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1070)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
        at java.lang.Thread.run(Thread.java:595)
07:47:00,165 ERROR HostConfig:484 - Error deploying configuration descriptor chapal.xml
java.io.IOException: java.util.zip.ZipException: error in opening zip file
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)

推荐答案

当 auto-deploy 设置为 true 并且我通过慢速连接将 war 文件上传到 Linux 服务器时,我看到了这个问题.出于某种原因,Tomcat 在完成上传到服务器之前尝试部署 WAR.关闭自动部署并手动执行,或者将文件 ftping 到服务器上除 webapps 之外的目录,然后将其移动到 webapps 可以解决问题.

I see this problem when auto-deploy is set to true and I am uploading the war file over a slow connection to a Linux server. For some reason, Tomcat attempts to deploy the WAR before it has finished uploading to the server. Turning off auto-deploy and doing it manually, or ftping the file to a directory on the server other then webapps and then moving it into webapps fixes the problem.

似乎是Tomcat没有等到文件上传完成才尝试展开的问题.

Seems to be a problem with Tomcat not waiting until the file is finished being uploaded before trying to expand it.

这篇关于部署 WAR 文件时出现 tomcat 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆