1

好吧,我有一个使用 Maven 构建并在 eclipse(tomcat runtime) 上运行的应用程序,它工作正常。但是当我在tomcat(不使用eclipse)上部署项目的WAR时,它失败了。该错误是由于我包含的定制罐造成的。

堆栈跟踪如下:-

Aug 26, 2013 3:18:16 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in dependencyCheck
java.io.IOException: Jar: smartcharging-model.jar
    at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:207)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1256)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:714)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:219)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:212)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    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: java.util.zip.ZipException: invalid distance too far back
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.jar.JarInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at java.util.jar.JarInputStream.getBytes(Unknown Source)
    at java.util.jar.JarInputStream.checkManifest(Unknown Source)
    at java.util.jar.JarInputStream.<init>(Unknown Source)
    at java.util.jar.JarInputStream.<init>(Unknown Source)
    at org.apache.catalina.util.ExtensionValidator.getManifest(ExtensionValidator.java:395)
    at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:196)
    ... 29 more

Aug 26, 2013 3:18:16 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Aug 26, 2013 3:18:16 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Smart-0.0.1-SNAPSHOT] startup failed due to previous errors
Aug 26, 2013 3:18:16 PM org.apache.catalina.util.LifecycleBase stop
INFO: The stop() method was called on component [WebappLoader[/Smart-0.0.1-SNAPSHOT]] after stop() had already been called. The second call will be ignored.
4

5 回答 5

0

mvn clean install

和你的代码

于 2013-08-26T10:30:49.513 回答
0

即使运行了上述所有命令,我仍然有问题。到目前为止,我找到了一种解决方法,即从部署在服务器上的 Target 中删除该 JAR 文件,然后再次复制它。我认为手动复制 JAR 可以解决问题。

于 2013-09-10T03:55:43.957 回答
0

听起来你有一个损坏的罐子。您是否尝试过从本地存储库 (~/.m2/repository) 中删除它并且

mvn clean package

再次 ?eclipse 可能不会与您用于在命令行中构建战争的存储库共享相同的存储库。

于 2013-08-26T13:21:55.780 回答
0

检查 META-INF 文件夹中生成的清单文件,确保'header : value'它们在同一行。

于 2016-12-22T10:43:08.097 回答
0

我遇到了同样的问题,它是由将 war 文件从 Windows 传输到 Unix 系统期间的编码问题引起的。

对于这个任务,我使用带有“标准”文件传输选项的 WinSCP。一旦我切换到“二进制”格式,它就可以工作,并且应用程序服务器可以读取战争。

于 2017-03-30T14:20:02.363 回答