This content has been marked as final.
Show 2 replies
-
1. Re: Deployers, Classloaders, and Reflection in JBoss 5
adrian.brock Jun 4, 2009 9:39 AM (in response to bryan.kearney)Help requests should really go in the user's forum:
http://www.jboss.org/index.html?module=bb&op=viewforum&f=228
My guess is that your problem lies with:but I assume are brought into the deployers classloader
The deployer's classloader is a very different thing to the application classloader
which you can get from DeploymentUnit.getClassLoader().
The application classloader will change on every redeployment.
You should make sure you unhook anything that references the old
classes or classloader in undeploy() so they can be garbage collected,
otherwise you'll leak classes and memory (which sounds like your real problem).
AFAIK, there's no deployer that uses the classloader directly. But we do have
deployers that pass the classloader into the component frameworks via their metadata,
which uses DeploymentUnit.getClassLoader().
e.g. http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java?revision=88706&view=markup
The closest we've got to what you are doing, uses our AnnotationScanning framework
to create metadata objects from annotated classes,
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanScanningDeployer.java?view=markup
they don't deal with the classloader explicitly. -
2. Re: Deployers, Classloaders, and Reflection in JBoss 5
bryan.kearney Jun 4, 2009 9:49 AM (in response to bryan.kearney)"adrian@jboss.org" wrote:
Help requests should really go in the user's forum:
http://www.jboss.org/index.html?module=bb&op=viewforum&f=228
Sorry.. dont know how I got here. I will repost in the other."adrian@jboss.org" wrote:
You should make sure you unhook anything that references the old
classes or classloader in undeploy() so they can be garbage collected,
otherwise you'll leak classes and memory (which sounds like your real problem).
At redeploy, we create a new engine for application. I will double check the undeploy logic however."adrian@jboss.org" wrote:
AFAIK, there's no deployer that uses the classloader directly. But we do have
deployers that pass the classloader into the component frameworks via their metadata,
which uses DeploymentUnit.getClassLoader().
e.g. http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java?revision=88706&view=markup
The closest we've got to what you are doing, uses our AnnotationScanning framework
to create metadata objects from annotated classes,
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanScanningDeployer.java?view=markup
they don't deal with the classloader explicitly.
I will check these.. thank you.