You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Ivan (JIRA)" <ji...@apache.org> on 2009/05/21 11:52:45 UTC

[jira] Commented: (GERONIMO-4545) TomcatJAASRealm keeps reference to undeployed EAR/WAR's classloader

    [ https://issues.apache.org/jira/browse/GERONIMO-4545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711544#action_12711544 ] 

Ivan commented on GERONIMO-4545:
--------------------------------

Seems that ContainerBase.getRealm() method will automatically delegate the request to its parent if no realm is found in its own scope, so we may not need to explicitly set the default realm for the context if we do not find any realm setting for the application itself.

> TomcatJAASRealm keeps reference to undeployed EAR/WAR's classloader
> -------------------------------------------------------------------
>
>                 Key: GERONIMO-4545
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4545
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Memory Leaks, security, Tomcat
>    Affects Versions: 2.2
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>            Priority: Blocker
>             Fix For: 2.2
>
>
> Another issue where an undeployed WAR's classloader is not GCed.
> {code}
> --> org.apache.geronimo.tomcat.realm.TomcatJAASRealm@0x2aaab10ab438 (180 bytes)  (field container:) exclude
> --> org.apache.geronimo.tomcat.GeronimoStandardContext@0x2aaab322d390 (749 bytes) (field parentClassLoader:) exclude
> --> org.apache.geronimo.kernel.config.MultiParentClassLoader@0x2aaab2e9b2e0 (156 bytes) (field parents:) exclude
> --> [Ljava.lang.ClassLoader;@0x2aaab0b97958 (88 bytes) (Element 1 of [Ljava.lang.ClassLoader;@0x2aaab0b97958:) exclude
> --> org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader@0x2aaab05e8bc0 (115 bytes) (field parent:) exclude
> --> org.apache.geronimo.kernel.config.MultiParentClassLoader@0x2aaab2e9b230 (156 bytes) exclude 
> {code}
> It looks to me like the TomcatJAASRealm (its name is "DefaultJAASRealm") is a standard realm that is used by all WARs without explicit configuration. Setting the realm of a GeronimoStandardContext makes the context store a reference to its realm AND makes the realm store a reference to the context (see org.apache.catalina.core.ContainerBase#setRealm() which GeronimoStandardContext inherits). Thus, the default realm's reference is always directed to the context of the WAR deployed most recently. This reference keeps the context from being GCed even if the corresponding WAR has been undeployed in the meantime.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.