My guess is that AOP is caching the classloader somewhere?
The most obvious candidate is this code in AOPDependencyBuilder:
| AspectManager manager = AspectManagerFactory.getAspectManager(metaData);
|
which eventually boils down to a lookup by a String based on the deployment name
AspectManagerFactory
| public static AspectManager getAspectManager(MetaData md)
| {
| AspectManager manager = AspectManager.instance();
| if (md != null)
| {
| ApplicationScope app = md.getMetaData(ApplicationScope.class);
| DeploymentScope dep = md.getMetaData(DeploymentScope.class);
| if (app != null && dep != null)
| {
| JBossStringBuilder fqn = new JBossStringBuilder("/");
| AspectManager sub = null;
| if (app != null)
| {
| String name="APPLICATION=" + app.value();
| fqn.append(name);
| fqn.append("/");
| sub = manager.findManagerByName(fqn.toString());
| if (sub == null)
| {
| sub = createNewDomain(manager, name);
| }
| }
|
| if (dep != null)
| {
| String name="DEPLOYMENT=" + dep.value();
| fqn.append(name);
| fqn.append("/");
| AspectManager parent = sub;
| sub = manager.findManagerByName(fqn.toString());
| if (sub == null)
| {
| sub = createNewDomain(parent, name);
| }
| }
| return sub;
| }
| }
| return manager;
| }
|
AspectManager:
| /** A map of domains by name */
| protected volatile WeakValueHashMap subDomainsByName =
UnmodifiableEmptyCollections.EMPTY_WEAK_VALUE_HASHMAP;
|
Although this is a WeakValueHashMap, there's no guarantee that
it will be reaped (depends when the GC runs) between redeployments
and there is no "remove" at undeployment.
So if something in the sub Domain created for the deployment name
references the old classloader, it is going to leak across redeployment.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126649#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...