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 06:31 Go to previous 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 06:32]

Report message to a moderator

 
Read Message
Read Message
Previous Topic:Spring Security for Multiple Web Page
Next Topic:Bundle startup order in virgin VWS
Goto Forum:
  


Current Time: Wed May 22 08:49:45 EDT 2013

Powered by FUDForum. Page generated in 0.01883 seconds