Skip to content

JMX InstanceAlreadyExistsException when deploying same app twice [SPR-1219] #5921

@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions