-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Nilesh Kapadia opened SPR-1219 and commented
I have an application that registers JMX beans using MBeanExporter. If I deploy this application twice I get org.springframework.beans.factory.BeanCreationException caused by javax.management.InstanceAlreadyExistsException because the MBeans are already registered under the given name, which causes the second app to fail to start. I have worked around this by making the name configurable at deploy time.
MBeanExporter could be improved by having a way to either recover from this (and not even bother to register the JMX beans), or to dynamically generate the names somehow to avoid a conflict?
In reference to this thread: http://forum.springframework.org/viewtopic.php?t=7783
Also I was able to workaround this issue by extending MBeanExporter and overriding registerBeans() to catch the exception (and continue so that deployment will succeed, even though JMX bean registration fails).
Affects: 1.2.3
Issue Links:
- MBeanExporter attempts to register duplicate MBeans causing javax.management.InstanceAlreadyExistsException [SPR-1216] #5918 MBeanExporter attempts to register duplicate MBeans causing javax.management.InstanceAlreadyExistsException ("duplicates")