我有一个在本地tomcat服务器上运行的Web应用程序,几天后无法访问。查看tomcat日志,发现以下日志。知道这里发生了什么吗?只需重新启动tomcat即可将问题再解决几天到一周
15-Oct-2019 06:34:26.792 SEVERE [http-nio-8080-exec-149] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [/powersync] threw exception
java.lang.NullPointerException
at org.apache.coyote.http11.Http11OutputBuffer.commit(Http11OutputBuffer.java:351)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:658)
at org.apache.coyote.Response.action(Response.java:167)
at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:207)
at org.apache.coyote.Response.doWrite(Response.java:502)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:375)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:420)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:345)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:405)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:393)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:999)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:425)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
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.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.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
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:620)
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:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
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)
答案 0 :(得分:0)
这可能是由于您可能在应用程序服务器中使用的HotSwap。只要您对现有方法进行修改,Hotswap将使您能够自由更改正在运行的应用程序,而无需重新启动服务器。据我了解,您似乎要长时间保持服务器在应用程序中运行。通常,这是由开发人员使用Hotswap或JRebel之类的程序运行其应用程序来完成的。
您遇到的问题是由于Hotswap在JVM中的工作方式所致。实际上,在对应用程序进行修改时,Hotswap会在JVM中添加资源。发生的问题是由于这些修改,最终将导致JVM崩溃。只要您使用Hotswap,您就必须在一段时间后定期重新启动JVM。
另一方面,JRebel实际上将为您提供查看JVM中更改的能力,而不必重新启动JVM。原因是由于JRebel不会移动资源,而是将JVM中的类加载器重新映射到通过您选择的IDE在本地修改的文件。
我是Perforce Software的JRebel团队的工程师。但是您遇到的问题是我经常与使用Hotswap运行其应用程序的开发人员一起遇到的。我希望这会有所帮助。