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
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
Craig McClanahan added a comment - 13/Nov/06 11:46 PM
Further research, plus a pointer in the right direction from Niall Pemberton[1], illustrates that the above steps (while a good idea to avoid memory leaks) are not sufficient to avoid leaving shale-dialog-basic-xxxxx.jar locked when undeploying on Windows. There is an issue in Digester 1.6 and 1.7 (but fixed in recent nightly builds) when you use the Digester.register() method to register instances of (say) DTDs that are present inside your JAR file, so that the application does not have to go out to the Internet to resolve them. Released versions of Digester leave an I/O channel to the internal DTD open when it is used in this way, which prevents the JAR file from being closed on Windows. The latest Digester trunk code uses a workaround to avoid this problem.

[1] http://issues.apache.org/jira/browse/DIGESTER-29

Craig McClanahan added a comment - 12/Dec/06 07:01 AM
We depend on Commons Digester 1.8 now, so this issue has been completely dealt with.