Announcement Announcement Module
Collapse
No announcement yet.
Exposing MBean in WebLogic 9 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exposing MBean in WebLogic 9

    Hi all,

    I am currently trying to expose an MBean in WebLogic 9's MBean server.
    First of all, using the simple approach works:

    Code:
    <context:mbean-export default-domain="${service.domain}"/>
    However, I want to change the strategy for handling an existing instance. As the above mentioned tag just expands to an AnnotationMBeanExporter I tried this:

    Code:
        <bean class="org.springframework.jmx.export.annotation.AnnotationMBeanExporter"
            p:registration-behavior-name="REGISTRATION_REPLACE_EXISTING"
            p:autodetect-mode-name="AUTODETECT_ASSEMBLER"
            p:default-domain="${service.domain}"
        />
    Though, here things do not work as expected. It looks to me, as if publication does happen in another MBean-server and not the existing one.

    Also this doesn't help:
    Code:
        <bean class="org.springframework.jmx.export.annotation.AnnotationMBeanExporter"
            p:registration-behavior-name="REGISTRATION_REPLACE_EXISTING"
            p:autodetect-mode-name="AUTODETECT_ASSEMBLER"
            p:default-domain="${service.domain}"
            p:server-ref="mbeanServer"
        />
    
        <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"
            p:locate-existing-server-if-possible="true"
        />
    I saw that in MBeanExportBeanDefinitionParser there is an invocation of MBeanServerBeanDefinitionParser.findServerForSpeci alEnvironment() which seems to make the difference. Now my question is, how do I have to configure things, so that the WebLogic MBean server is used?

    BTW: Some more configuration properties in context:mbean-export might be helpful.

    Regards,
    Andreas

  • #2
    Solved

    I digged a bit further and came up with this solution, which works as expected:

    Code:
        <bean class="org.springframework.jmx.export.annotation.AnnotationMBeanExporter"
            p:registration-behavior-name="REGISTRATION_REPLACE_EXISTING"
            p:autodetect-mode-name="AUTODETECT_ASSEMBLER"
            p:default-domain="${service.domain}"
            p:server-ref="mbeanServer" 
        />
    
        <bean id="mbeanServer" class="org.springframework.jndi.JndiObjectFactoryBean"
            p:jndi-name="java:comp/env/jmx/runtime"
            p:proxy-interface="javax.management.MBeanServer"
        />
    However, I find it a bit annoying that I cannot use context:mbean-export here. So I opened a Jira-issue, proposing an improvement in configurability:
    http://opensource.atlassian.com/proj...rowse/SPR-4245

    Comment

    Working...
    X