Change dynamic propertie with MBean
chendaMar 18 2013 — edited Mar 18 2013Hello,
I have implemented a MBean config instead of using properties file as It allows me to change the value during runtime, without restarting the server.
For that, i used the org.springframework.jmx.export.MBeanExporter and register this bean into my spring config file.
<bean id="ConfigJMX" class="xyz.mbean.ConfigImpl">
<property name="fileName" value="/tmp/toto.txt"/>
</bean>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<property name="beans">
<map>
<entry key="xyz:name=MyConfig" value-ref="ConfigJMX"/>
</map>
</property>
</bean>
I have added the following library In the MANIFEST under runtime classpath.
I have added the following JARs to satisfy classpath issue (I don't know if it is the right way of doing with CEP ?)
- lib/org.springframework.spring-context_2.5.6.jar
- lib/org.springframework.spring-core_2.5.6.jar
- lib/org.springframework.spring-aop_2.5.6.jar
Compilation is fine, but during the deployment, i have the following exception:
../..
Caused By: org.springframework.beans.FatalBeanException: Could not create service reference; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.IntroductionInfo is not visible from class loader
at com.bea.wlevs.spring.support.ServiceInjectionBeanPostProcessor.postProcessPropertyValues(ServiceInjectionBeanPostProcessor.java:128)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:998)
../..
Seems that cep engine refuse to 'register' thoses libraries.
Could you provide the right way of dealing with this issue ?
Or
Do we have a better mecanism to implement what i'm trying to do in CEP (loading and changing properties value during runtime without restarting the server)?
Regards,
chenda