Frage

I'm deploying a spring application to OC4J, however keep encountering a strange problem whereby i can access the exposed mbeans, however only use the attributes and operations. The notifications can been seen under the tab, however not used as there should be a checkbox present with an apply button to subscribe. This isn't present and instead is just the boolean value of false that shows i'm definitely not subscribed to that notification.

Here is the spring config which i use to register mbeans:

<bean id="test" class="com.app.jmx.HomeController"/>

<bean id="MbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="defaultDomain" value="MbeanServer" />
</bean>

<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="autodetect" value="false" />
    <property name="server" ref="MbeanServer" />
    <property name="beans">
        <map>
            <entry key=":name=test" value-ref="test" />
        </map>
    </property>
</bean>

And here is the code used to create the notifications

    private String notifications[] = { "increment", "decrement", "reset",
"test" };

public MBeanNotificationInfo[] getNotificationInfo() {
    MBeanNotificationInfo[] info = { new MBeanNotificationInfo(
            notifications, "javax.management.Notification",
            "Notifications set for SimpleNotifier") };
    return info;
}   

An example of this working without spring can be found here http://www.oracle.com/technetwork/middleware/ias/readme-087860.html

Any help on this would be greatly appreciated as i've found very limited sources online about the combination of Spring, jmx and oc4j with jmx notifications, thanks!

War es hilfreich?

Lösung

This was a problem with the mbeanserver within spring config file.

<bean id="mbeanserver" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="false" />
</bean>

solved the issue

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top