2017-03-16 81 views
1

環境信息無法啓動引起拋出:IllegalArgumentException

  • Tomcat的Tomcat的戰爭:8.5.9
  • JDK:1.8.0_112-B16

WAR文件可以使用Tomcat的Web部署應用程序管理器成功,但未能啓動。戰爭文件可以解壓縮得很好,所以我認爲這是一個有效的zip文件。

詳細的例外是

16-Mar-2017 14:34:11.792 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.ApplicationContext.log FAIL - Application at context path /propertyMS-1.0 could not be started 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/propertyMS-1.0]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) 
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1307) 
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:669) 
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591) 
    at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:319) 
    at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:88) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) 
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) 
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) 
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) 
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437) 
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.IllegalArgumentException: The archive [jar:file:/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0.war!/] is malformed and will be ignored: an entry contains an illegal path [./] which was not expanded to [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0] since that is outside of the defined docBase [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0/] 
    at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141) 
    at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:615) 
    at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:748) 
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301) 
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) 
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149) 
    ... 35 more 

感謝。

更新:然後

至於建議我擴大戰爭到一個文件夾部署文件夾複製到同一Tomcat服務器和它的作品。我不確定戰爭文件有什麼問題。它可以解壓縮,所以它至少應該是一個有效的zip文件。

+0

可能的dublicate的http://stackoverflow.com/questions/ 8117526/tomcat-error-deployment- –

+0

嘗試展開webapp-folder中的war並重新啓動tomcat。 –

+0

@TobiasOtto如果我把擴展文件夾放到webapp文件夾中,它可以工作。仍然不確定戰爭文件有什麼問題。 –

回答

1

我只能說,確保它只包含來自項目路徑的文件。

當你將文件添加到戰爭中時,我認爲有一些選項可以包含原始路徑結構(不要使用它),因爲當tomcat嘗試將存檔提取到該路徑時(out of webapps/project dir)它會失敗......

嘗試使用命令列出檔案條目,並看看是否有任何條目有一個輸出路徑項目目錄

+0

在我們的案例中,問題是由我們的構建腳本引起的,這些腳本在包含一些Javascript和依賴項文件的war文件中添加了一個隱藏目錄。 –

相關問題