Announcement Announcement Module
Collapse
No announcement yet.
trouble with mbean-export and DefaultDomain Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trouble with mbean-export and DefaultDomain

    I tried to switch to an annotation based configuration for my mBeans that are shared among all of my Spring Web Service applications.

    We use OC4J, and it requires an 'empty' domain. When we use an empty domain for our mBeans, OC4J will automatically put the mBeans into the domain of the application and name it appropriately. Therefore it helps us out to prevent collisions.

    So, My mBeans are annotated...

    @ManagedResource(objectName = ":name=Log4jManager")

    and

    @ManagedResource(objectName=":name=ManagedCachingC onnection")

    And the Spring Context call is ...

    <context:mbean-export default-domain="" />

    BUT Spring still decides to put on the 'DefaultDomain' when it performs MetadataNamingStrategy. This creates collisions from other WS we have deployed.

    Previously we did this... which worked fine. The use of the empty domain, and when OC4J receives it in the doRegister of mBeanRegistrationSupport it will automatically put it into the application's domain.

    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServer FactoryBean" />

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporte r">
    <property name="beans">
    <map>
    <entry key=":name=log4jManager" value-ref="log4jManager" />
    </map>
    </property>
    <property name="server" ref="mbeanServer" />
    </bean>

  • #2
    Please use [ code][/code ] tags when posting code.

    The point is that the namespace check for empty input and then sets the defaultdomain... One thing you might try is instead of the objectName set the value property (i.e. remove objectName = )...

    Comment

    Working...
    X