Hello,
I mean to configure JMX management for a bean of mine used by 2 webapps in one JavaEE app. The application is deployed to JBoss 5.0.1 GA. Here is my JMX config
<bean id="mBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true"/>
</bean>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<property name="beans">
<map>
<entry key="bean:name=myJMXBean"
value-ref="myService"/>
</map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
<property name="managedInterfaces">
<value>
com.me.MyServiceJMXInterface
</value>
</property>
</bean>
</property>
<property name="server" ref="mBeanServer"/>
</bean>
At the beginning, I got error like MBean bean:name=myJMXBean already registered. Figured it must be the MBean getting registered to the 2 webapps in my app. THen I added the following line to the bean exporter
<property name="registrationPolicy" value="IGNORE_EXISTING" />
The error is gone. But if I try to use JConsole to access the MBean and change the value, it is kind of unknown which instance of myService that I'm getting. It must be a well-defined problem seen by many people before. Can someone please shed some light onto how I can do this?
Also, is there a way to have the line in JBoss log file prefix'ed by the web application name that it is deploying?
Hope I make it clear. Thanks a lot for your kind helps. I found JBoss community very helpful before
Error