gpt4 book ai didi

jsf - MyFaces 中的内存泄漏

转载 作者:行者123 更新时间:2023-12-04 14:04:53 27 4
gpt4 key购买 nike

EDIT: The solution that you can find in comments below assumes changing JSF implemenetation from MyFaces to Sun's Mojarra.

你好,

我在使用 MyFaces 2.0.0 时遇到了非常烦人的问题(更准确地说,我也在 2.0.1 和 2.0.2 上检查过它,但问题仍然存在)。

我现在正在 MyFaces 下编写应用程序。简而言之,在我的应用程序中,我使用框架:Spring、Hibernate、JSF(MyFaces 实现)我的应用容器是Tomcat(6.0.29版本)我使用 maven 来构建和部署(3.0 版)。

问题是当我尝试通过 Maven (mvn tomcat:redeploy) 重新部署应用程序时,它首先尝试取消部署应用程序并再次部署它。但是取消部署永远不会成功。我有信息:

SEVERE: The web application [/adam] created a ThreadLocal with key of type 
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4b0a4d7c]) and a value of type
[org.apache.myfaces.config.RuntimeConfig] (value org.apache.myfaces.config.RuntimeConfig@11652e61])
but failed to remove it when the web application was stopped.
This is very likely to create a memory leak.

由于这个错误,tomcat 无法取消部署应用程序:

INFO: Undeploying context [/adam]
2010-12-02 11:47:46 org.apache.catalina.startup.ExpandWar deleteDir
SEVERE: [D:\Program Files\apache-tomcat-6.0.29\webapps\adam\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems
2010-12-02 11:47:46 org.apache.catalina.startup.ExpandWar deleteDir
SEVERE: [D:\Program Files\apache-tomcat-6.0.29\webapps\adam\WEB-INF] could not be completely deleted. The presence of the remaining files may cause problems
2010-12-02 11:47:46 org.apache.catalina.startup.ExpandWar deleteDir
SEVERE: [D:\Program Files\apache-tomcat-6.0.29\webapps\adam] could not be completely deleted. The presence of the remaining files may cause problems
2010-12-02 11:47:46 org.apache.catalina.startup.ExpandWar delete
SEVERE: [D:\Program Files\apache-tomcat-6.0.29\webapps\adam] could not be completely deleted. The presence of the remaining files may cause problems
2010-12-02 11:47:49 org.apache.catalina.startup.HostConfig deployDirectory

我在 WEB-INF\lib 中的所有库和我保存 Log4J 日志的文件都无法删除。

还存在来自提供 ELFactoryImpl 的库的连接内存泄漏:

SEVERE: The web application [/adam] created a ThreadLocal with key of type [null]
(value [org.apache.myfaces.el.convert.VariableResolverToELResolver$1@693985fc])
and a value of type [java.util.HashSet] (value [[]]) but failed to remove it
when the web application was stopped.
This is very likely to create a memory leak.

如何消除这种内存泄漏?

我一直在寻找答案,但我找不到任何解决方案。我在 myface 的 jira 上发现了这个问题:https://issues.apache.org/jira/browse/MYFACES-2942但我不知道该怎么想。我应该等待 2.0.3 版吗?

我认为 EL 的内存泄漏与第一个有关。

请帮帮我! ;) 如果需要,我可以提供更多详细信息。

最佳答案

该问题已被报告并将被修复。截至目前,您有 3 个选择:

  1. 接受警告消息并等待 MyFaces 人员发布修复程序。

  2. 在您当前的 MyFaces 实现中应用建议的补丁。

  3. 将 MyFaces 替换为 Mojarra (引用实现)没有暴露这个问题。

关于jsf - MyFaces 中的内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4334510/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com