.War在Windows上部署但无法在Linux服务器上部署(Tomcat 7)

正如标题所介绍的,我试图使用Tomcat 7部署的.War文件不能在运行Linux的机器上运行。 它可以在Windows上运行,当然也可以在Tomcat 7上部署。

我试图单独追踪这个问题,并在网上search相关的问题,包括这个论坛,迄今为止没有成功。 这就是为什么我创build这个线程寻求帮助/提示。

我跟踪的错误消息如下:

Sep 14, 2015 4:46:05 PM org.apache.catalina.deploy.NamingResources cleanUp WARNING: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SmartHomeReasoner]] so no cleanup was performed for that container javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp]. at org.apache.naming.NamingContext.lookup(NamingContext.java:819) at org.apache.naming.NamingContext.lookup(NamingContext.java:167) at org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:986) at org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:968) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5676) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:141) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1256) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:692) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 

这实际上是造成这个问题的两个问题。

要解决这个问题,我不得不:

*在发生任何错误之后,比如servlet等不存在我们已经定义的东西,例如驱动被定义了两次,意味着它已经被定义在某个地方,同样也在web.xml中。

*删除项目的.. \ WEB-INF \ lib文件夹中的servlet。 例如,在这种情况下,javax.servlet-api-3.0.1.jar + javax.servlet-api-3.1.0.jar被删除。 注意我甚至在项目级别上有可能相互冲突的jar,但是我仍然能够在Windows上成功部署,但是在Linux上却不能。

相信我所提到的这两件事情都可能是一个问题,如果你从其他开发者那里做了这个错过的工作,很可能是一个问题。