EDIT: The solution that you can find in comments below assumes changing JSF implemenetation from MyFaces to Sun's Mojarra.
Hi,
I have got really annoying problem with MyFaces 2.0.0 (To be more precisely I checked it out also on 2.0.1 and 2.0.2 and problem remains).
I'm writing now application under MyFaces. Briefly speaking in my application i use frameworks: Spring, Hibernate, JSF (MyFaces implementation) My application container is Tomcat (6.0.29 version) I use maven to build and deploy (version 3.0).
The problem is when I try to redeploy application via maven (mvn tomcat:redeploy) it tries first to undeploy application and the deploy it again. But undeploying never suceed. I've got information:
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.
Due to this error tomcat cannot undeploy application:
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
All of my libraries in WEB-INF\lib and my file where i keep logs from Log4J cannot be deleted.
There is also connected memory leak from library that provides 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.
How to get rid of this memory leaks ?
I have been looking for answer really long I cannot find any solution. I found this issue on myface's jira: https://issues.apache.org/jira/browse/MYFACES-2942 But I don't know what to think about it. Should I wait for version 2.0.3 ?
I think that memory leak from EL is connected to first one.
Please, help me ! ;) I can provide more details if needed.