Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » JMX Mbean registration and configuration artifacts
JMX Mbean registration and configuration artifacts [message #799849] Thu, 16 February 2012 11:31 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Hello.

This topic was started in another thread, but the thread got too noisy to expose the real issues I am facing.

I have a JMX MBean being registered in a Virgo Kernel. The bean is created via Spring and is defined in a Spring config file that uses placeholder variable substitution via the configuration artifact mechanism. In particular, the variable that should be substituted is the serviceUrl parameter for the MBean server.

Unfortunately the placeholder substitution does not seem to take place and the MBean gets registered under the default serviceUrl.

I have tested the usage of configuration artifact for other, non JMX related, parameters and that works perfectly well. So I am led to believe that the issue is specific to the creation of the JMX MBean, perhaps a lifecycle issue. Is it possible that the bean is published on the default RMI port BEFORE Virgo has a chance to do the variable susbtitution?

Below is the relevant snippet of the Spring config file I have:
<context:property-placeholder properties-ref="configAdminProperties"/>
<osgi-compendium:cm-properties id="configAdminProperties" persistent-id="core.featurelauncher-properties"/>

<bean id="featureLauncherMBean"
	class="com.iggroup.wb.core.featurelauncher.internal.DefaultFeatureLauncher"
		init-method="init" destroy-method="dismissAllFeatures">
</bean>

<util:map id="exposedMBeans">
       <entry key="bean:type=featureLauncherMBean,name=remoteJMX"
			value-ref="featureLauncherMBean" />
</util:map>

<bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"
        p:beans-ref="exposedMBeans" p:assembler-ref="assembler" lazy-init="false"/>
	
<util:list id="manageableInterfaces">
	<value>com.iggroup.wb.core.featurelauncher.api.FeatureLauncherMBean</value>
</util:list>

<bean id="assembler"
	class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler" p:managedInterfaces-ref="manageableInterfaces" />

<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"
        p:port="${registry.port}" />

<bean id="serverConnector"
	class="org.springframework.jmx.support.ConnectorServerFactoryBean"
	depends-on="registry" p:objectName="connector:name=rmi"
	p:serviceUrl="${serverconnector.serviceurl}" />


and the properties file core.featurelauncher-properties.properties contains:

registry.port = 1100
serverconnector.serviceurl = service:jmx:rmi://localhost/jndi/rmi://localhost:1100/jmxrmi


I am using Virgo Kernel 3.0.0.RELEASE and Spring Framework 3.0.5.

TIA,
B.

[Updated on: Thu, 16 February 2012 11:32]

Report message to a moderator

Re: JMX Mbean registration and configuration artifacts [message #800617 is a reply to message #799849] Fri, 17 February 2012 09:28 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
In the Spring DM 1.2.1 Reference section on config admin I don't see any mention of the use of the special "p" namespace. Have you tried something closer to what is suggested there? Could be a Spring DM issue or limitation.
Previous Topic:Spring Security for Multiple Web Page
Next Topic:Bundle startup order in virgin VWS
Goto Forum:
  


Current Time: Thu Oct 23 16:32:05 GMT 2014

Powered by FUDForum. Page generated in 0.02328 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software