WAR文件部署在一台机器上运行,但在另一台机器上运行

时间:2017-07-24 04:39:05

标签: maven tomcat tomcat7 war web-deployment

我在两台不同的机器上使用完全相同的方法安装了Tomcat。两者都使用找到here

的Windows服务安装程序

我生成的WAR文件正在执行mvn clean install -X。然后,我将WAR文件复制到另外两台Windows机器,并尝试通过Web App Manager进行部署,并将WAR文件放在\ webapps文件夹中。我可以在一台机器上启动应用程序,但不能在另一台机器上启动。同样,Tomcat安装完全相同,我尝试在应用程序未启动的机器上重新安装Tomcat,但之后仍然无法启动我的应用程序。

以下是应用程序运行所在机器的tomcat7-stdout.log:

2017-07-21 11:58:28 Commons Daemon procrun stdout initialized

这是应用程序不起作用的机器上的tomcat7-stdout.log。有一个NullPointerException显示缺少某些东西,但我不确定是什么。 Tomcat 7.0 \ libs文件夹中的依赖项在两台计算机之间是相同的。

INFO  [2017-07-21 23:45:13,343] be.fluid_it.tools.dropwizard.box.bridge.JEEBridge: Dummy start Jetty server ...
INFO  [2017-07-21 23:45:13,354] com.sample.sam.core.FrameworkManager: Loading OSGI framework.
INFO  [2017-07-21 23:45:13,375] com.sample.sam.core.FrameworkManager: Starting OSGI framework.
WARN  [2017-07-21 23:45:13,919] org.eclipse.jetty.util.component.AbstractLifeCycle: FAILED com.sample.sam.core.FrameworkManager@172ac2a5: java.lang.NullPointerException
! java.lang.NullPointerException: null
! at com.sample.sam.core.FrameworkManager.loadFrameworkBundles(FrameworkManager.java:98) ~[sam-portal-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
! at com.sample.sam.core.FrameworkManager.start(FrameworkManager.java:132) ~[sam-portal-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
! at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27) ~[dropwizard-lifecycle-0.9.2.jar:0.9.2]
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.13.v20150730.jar:9.2.13.v20150730]
! at com.sample.sam.PortalWebApplication.contextInitialized(PortalWebApplication.java:65) [classes/:na]
! at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118) [catalina.jar:7.0.79]
! at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634) [catalina.jar:7.0.79]
! at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:7.0.79]
! at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1312) [catalina.jar:7.0.79]
! at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:683) [catalina.jar:7.0.79]
! at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:209) [catalina.jar:7.0.79]
! at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) [servlet-api.jar:na]
! at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [servlet-api.jar:na]
! at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.79]
! at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.79]
! at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.79]
! at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.79]
! at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.79]
! at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) [catalina.jar:7.0.79]
! at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) [catalina.jar:7.0.79]
! at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615) [catalina.jar:7.0.79]
! at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [catalina.jar:7.0.79]
! at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.79]
! at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) [catalina.jar:7.0.79]
! at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.79]
! at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) [catalina.jar:7.0.79]
! at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) [tomcat-coyote.jar:7.0.79]
! at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) [tomcat-coyote.jar:7.0.79]
! at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) [tomcat-coyote.jar:7.0.79]
! at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_112]
! at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_112]
! at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.79]
! at java.lang.Thread.run(Unknown Source) [na:1.8.0_112]
INFO  [2017-07-21 23:45:14,035] com.sample.sam.core.FrameworkManager: Stopping OSGI framework.
INFO  [2017-07-21 23:45:14,112] com.sample.sam.core.FrameworkManager: OSGI framework stopped.
INFO  [2017-07-21 23:45:14,112] com.sample.sam.PortalWebApplication: Deregistering JDBC driver com.sap.db.jdbc.Driver@247eef58

关于为什么完全相同的Tomcat安装和WAR文件在一台机器上工作而不在另一台机器上工作的任何建议将不胜感激!

1 个答案:

答案 0 :(得分:0)

你能分享日志吗? 你在使用一些额外的图书馆吗?

可以放在

的服务器lib文件夹中
apache-tomcat-x.x\lib