google-code-export / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
2 stars 1 forks source link

JMX Manager.manage in webapps #344

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

It seems to me that if I use Manager.manage in a webapp it will break
during redeployment. When the webapp redeploys the JMX namespace is taken
and an exception is thrown like 

Exception: javax.management.InstanceAlreadyExistsException:
Myserver:type="com.google.inject.Injector

Is there a way to cleanup the jmx?

Obviously using a ServletLifeCycle listener and going through the jmx
domain unregistering each bean is one option.

Original issue reported on code.google.com by big...@gmail.com on 4 Mar 2009 at 6:29

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 26 Apr 2009 at 9:06

GoogleCodeExporter commented 9 years ago
In case it's not clear, this is the source of a memory leak and one of the 
reasons the webappclassloader cannot be garbage collected.

Original comment by jwarnerb...@gmail.com on 15 Oct 2010 at 1:52

GoogleCodeExporter commented 9 years ago
Yes, it would seem that if you tell JMX about a bean, you need to also tell JMX 
to stop handling the bean before you can tell it to handle another one of the 
same type.

Original comment by sberlin on 19 Feb 2011 at 10:28