Oct 5th, 2012, 10:48 AM
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 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">
<entry key=":name=log4jManager" value-ref="log4jManager" />
<property name="server" ref="mbeanServer" />
Oct 8th, 2012, 01:17 AM
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 = )...
Tags for this Thread