我无法在Tomcat服务器上部署Web应用程序。奇怪的是,它在我设置的第二个测试服务器上工作正常。我尽力使两台机器上的环境尽可能相似,并以相同的方式部署应用程序。我现在还不确定如何进行故障排除。
两个服务器都在Tomcat/8.0.37
上运行JVM 1.8.0_101-b13
,带有MySQL后端(版本14.14 Distrib 5.7.15 for Linux (x86_64) using EditLine wrapper
)。两者的操作系统都是Ubuntu 14.04,尽管它们由不同的云提供商托管。我已经通过Manager App的上传功能在两台服务器上部署了.WAR文件。在非工作服务器上,单击“开始”将产生错误 FAIL - 无法启动上下文路径/ mediaServer上的应用程序。在Tomcat的logs/catalina.out
文件中,我看到了这个警告:
19-Sep-2016 20:45:29.239 WARNING [http-nio-8080-exec-1]
org.springframework.context.support.AbstractApplicationContext.doClose
Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call
'refresh' before invoking lifecycle methods via the context: Root
WebApplicationContext: startup date [Mon Sep 19 20:45:29 UTC 2016]; root
of context hierarchy
at org.springframework.context.support.AbstractApplicationContext
.getLifecycleProcessor(AbstractApplicationContext.java:359)
at org.springframework.context.support.AbstractApplicationContext
.doClose(AbstractApplicationContext.java:890)
at org.springframework.context.support.AbstractApplicationContext
.close(AbstractApplicationContext.java:843)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext
(ContextLoader.java:579)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed
(ContextLoaderListener.java:115)
at org.apache.catalina.core.StandardContext.listenerStop
(StandardContext.java:4900)
at org.apache.catalina.core.StandardContext.stopInternal
(StandardContext.java:5537)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1284)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:666)
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:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:207)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter
(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:207)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter
(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:614)
at org.apache.catalina.valves.RequestFilterValve.process
(RequestFilterValve.java:313)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:86)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke
(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process
(AbstractHttp11Processor.java:1100)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process
(AbstractProtocol.java:687)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
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)
19-Sep-2016 20:45:29.249 WARNING [http-nio-8080-exec-5]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [mediaServer] appears to have started a thread named
[Abandoned connection cleanup thread] but has failed to stop it. This is
very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
com.mysql.jdbc.NonRegisteringDriver$1.run(NonRegisteringDriver.java:93)
我在工作服务器上看不到这样的警告。
不确定它是否相关,但工作服务器的Tomcat管理器将操作系统版本显示为3.13.0-30-generic
,而非工作服务器显示4.7.0-x86_64-linode72
。
其他细节:
编辑:
webapps
目录中手动部署。问题仍然存在,完整的错误日志位于此处:http://sprunge.us/BKLg