如何修复或处理部署在 Apache Tomcat 7 中的 Java Struts 1.3 应用程序中的 File Reaper 线程内存泄漏问题?

问题描述 投票:0回答:1

我已在 Apache Tomcat 7.0.41 中部署了一个 Struts 1.3 Web 应用程序。 Tomcat 服务器似乎经常挂起并且无法处理任何请求,在浏览器上显示页面未找到错误,类似于停止的 Tomcat 服务器,但实际上在 Windows 服务中 Tomcat 服务仍然显示为已启动。重启后服务器工作正常。

Apache Software Foundation\Tomcat 7.0\logs omcat7-stderr.2013-07-05.log 中记录了以下错误:

Jul 5, 2013 11:57:48 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
    SEVERE: The web application [/pms] appears to have started a thread named [File Reaper] but has failed to stop it. This is very likely to create a memory leak.
    Jul 5, 2013 11:57:53 AM org.apache.coyote.AbstractProtocol stop
    INFO: Stopping ProtocolHandler ["http-bio-8085"]
    Jul 5, 2013 11:57:54 AM org.apache.coyote.AbstractProtocol stop
    INFO: Stopping ProtocolHandler ["ajp-bio-8010"]
     javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
        at java.util.Properties$LineReader.readLine(Unknown Source)
        at java.util.Properties.load0(Unknown Source)
        at java.util.Properties.load(Unknown Source)
        at com.krwssa.log.SystemLogManager.getLogger(SystemLogManager.java:39)
        at com.krwssa.db.DatabaseConnection.<clinit>(DatabaseConnection.java:14)
        at com.krwssa.action.LoginAction.login(LoginAction.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
        at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Exception in thread "http-bio-8085-exec-127" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "http-bio-8085-exec-133" java.lang.OutOfMemoryError: Java heap space
        at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:99)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:931)
    Exception in thread "http-bio-8085-exec-103" Exception in thread "http-bio-8085-Acceptor-0"     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    java.lang.OutOfMemoryError: Java heap space
    Exception in thread "http-bio-8085-AsyncTimeout"    at java.net.Socket.setSoLinger(Unknown Source)
        at org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:194)
        at org.apache.tomcat.util.net.JIoEndpoint.setSocketOptions(JIoEndpoint.java:485)
        at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:228)
        at java.lang.Thread.run(Unknown Source)
    java.lang.OutOfMemoryError: Java heap space
    java.lang.OutOfMemoryError: Java heap space
    2013-07-05 06:57:58 Commons Daemon procrun stderr initialized

Web 应用程序确实包含一些具有 Struts 1.3

FormFile
元素的表单,用于将文件上传到服务器。该应用程序在 MyEclipse IDE 中配置的 Tomcat 开发模式下运行良好。看来 File Reaper 线程是罪魁祸首,是吗?如何解决或处理这个问题?

java struts struts-1
1个回答
0
投票

您应该配置数据库设置以与 Tomcat 服务器一起运行。您的后期配置未知,但我猜您只是没有在应用程序中包含数据库驱动程序,或者 Tomcat 服务器上未安装数据库驱动程序。

© www.soinside.com 2019 - 2024. All rights reserved.