Issue Details (XML | Word | Printable)

Key: SHALE-274
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Craig McClanahan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Shale

[dialog2] Clean up static resources at application shutdown

Created: 04/Sep/06 08:21 PM   Updated: 23/Jan/07 04:40 PM
Return to search
Component/s: Dialog
Affects Version/s: None
Fix Version/s: 1.0.4

Issue Links:
Dependency
 


 Description  « Hide
The legacy dialog2 implementation relies on both Commons Logging and Commons Digester (which implies a transitive dependence on Commons BeanUtils). Therefore, we need to clean up at application shutdown by executing the following in a contextDestroyed() lifecycle listener (or equivalent):

    PropertyUtils.clearDescriptors();
    LogFactory.release(Thread.currentThread().getContextClassLoader());



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #473638 Sat Nov 11 04:16:19 UTC 2006 craigmcc Partial fix for cleaning up static resources at application shutdown
(SHALE-274) for the basic implementation. This took several changes:
* We needed a servlet context listener that can call
  PropertyUtils.clearDescriptors() and LogFactory.release().
* In order to get this without requiring the user to configure a listener
  manually in web.xml, create a dummy "tag library" inside the JAR
  (META-INF/taglib.tld) that serves to declare the listener.
* Since we now have an application startup/shutdown instance, migrate
  the dialog configuration parsing from "first use" in BasicDialogManager
  to "application startup time" as well.

With these changes, we have successfully cleaned up issues that caused
the Commons BeanUtils and Commons Logging jars to remain locked after
undeployment on a Windows platform. However, there is still something
that prevents shale-dialog-basic-xxx.jar itself from being deleted -- and
this means there will be a memory leak over multiple application deploys
and undeploys. This needs to be investigated and fixed before this issue
can be considered as "dealt with" for the basic implementation.

The Commons SCXML implementation is going to need the same sort of changes
(can be tagged against SHALE-274 as well), but it's likely to have its own
set of different issues about leaving the shale-dialog-scxml-xxx.jar file
locked.
Files Changed
ADD /shale/framework/trunk/shale-dialog-basic/src/main/resources/META-INF/taglib.tld
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java
MODIFY /shale/framework/trunk/shale-dialog-basic
ADD /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicLifecycleListener.java
MODIFY /shale/framework/trunk/shale-dialog-basic/pom.xml

Repository Revision Date User Message
ASF #474543 Mon Nov 13 22:36:41 UTC 2006 craigmcc Further work on SHALE-274 ... close the input stream for each parsed
configuration resource. This doesn't solve the locked JAR file problem,
but it is the right thing to do anyway.
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/config/ConfigurationParser.java

Repository Revision Date User Message
ASF #474604 Tue Nov 14 00:33:10 UTC 2006 craigmcc Close parsed input streams, to avoid the potential for leaving JAR files
locked on Windows after an undeploy (as with SHALE-274). Webapps will still
need a version of Digester newer than 1.7 for the Digester part of the fix.
Files Changed
MODIFY /shale/framework/trunk/shale-tiger/src/main/java/org/apache/shale/tiger/config/FacesConfigParser.java

Repository Revision Date User Message
ASF #476713 Sun Nov 19 05:10:57 UTC 2006 rahul Clean up static resources, parse dialog configs at startup/deploy rather than first access. Same scheme as one in shale-dialog-basic from r473638.
SHALE-274
Files Changed
MODIFY /shale/framework/trunk/shale-dialog-scxml/pom.xml
ADD /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLLifecycleListener.java
ADD /shale/framework/trunk/shale-dialog-scxml/src/main/resources/META-INF/taglib.tld