mroosendaal
Apr 4th, 2006, 03:04 AM
Hi,
I have an EAR-file which contains a .sar file that starts the Spring context. It contains a JMX bean defined as:
<!-- ********************* JMX Configuration for Spring ************************ -->
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=LO3IDVProcess" value-ref="lo3idvmbean"/>
</map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.MethodNam eBasedMBeanInfoAssembler">
<property name="managedMethods">
<value>stopIDVPRocessing,startIDVPRocessing,isRunning</value>
</property>
</bean>
</property>
</bean>
<bean id="lo3idvmbean" class="nl.ictu.spg.integration.idvmessageprocessing.jmx.L O3IDVBackgroundMBean">
</bean>
The first time the Spring context is initlized fine but when i hotredeploy (on JBoss 4.0.2) i get:
08:56:22,261 INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'lo3idvmbean'
08:56:22,292 INFO [MBeanExporter] Unregistering JMX-exposed beans on shutdown
08:56:22,292 INFO [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory
defining beans [dataSource,sessionFactory,SystemProperties,transac tionManager,abstractTxDefinition,BaseTableDAOTarge t,BaseTableDAO,LO3PLDAOTarget,LO3
PLDAO,WorkflowDAOTarget,WorkflowDAO,dao,pldao,LO3B erichtDAOTarget,LO3BerichtDAO,USI,messagesender,jm sTemplate,jmsConnectionFactory,exporter,lo3idvmbea
n]; root of BeanFactory hierarchy}
08:56:22,308 INFO [LocalSessionFactoryBean] Closing Hibernate SessionFactory
08:56:22,308 INFO [SessionFactoryImpl] closing
08:56:22,308 ERROR [SpgServiceLocator] Error initializing Spring ApplicationContext
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [config/applicationCo
ntext-ejb.xml]: Initialization of bean failed; nested exception is javax.management.InstanceAlreadyExistsException: bean:name=LO3IDVProcess already re
gistered.
javax.management.InstanceAlreadyExistsException: bean:name=LO3IDVProcess already registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.ad d(BasicMBeanRegistry.java:755)
at org.jboss.mx.server.registry.BasicMBeanRegistry.re gisterMBean(BasicMBeanRegistry.java:211)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
I can see my EJB being removed but why isn't the jmx bean removed? Does anyone know howto do this.
thanks,
Maarten
I have an EAR-file which contains a .sar file that starts the Spring context. It contains a JMX bean defined as:
<!-- ********************* JMX Configuration for Spring ************************ -->
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=LO3IDVProcess" value-ref="lo3idvmbean"/>
</map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.MethodNam eBasedMBeanInfoAssembler">
<property name="managedMethods">
<value>stopIDVPRocessing,startIDVPRocessing,isRunning</value>
</property>
</bean>
</property>
</bean>
<bean id="lo3idvmbean" class="nl.ictu.spg.integration.idvmessageprocessing.jmx.L O3IDVBackgroundMBean">
</bean>
The first time the Spring context is initlized fine but when i hotredeploy (on JBoss 4.0.2) i get:
08:56:22,261 INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'lo3idvmbean'
08:56:22,292 INFO [MBeanExporter] Unregistering JMX-exposed beans on shutdown
08:56:22,292 INFO [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory
defining beans [dataSource,sessionFactory,SystemProperties,transac tionManager,abstractTxDefinition,BaseTableDAOTarge t,BaseTableDAO,LO3PLDAOTarget,LO3
PLDAO,WorkflowDAOTarget,WorkflowDAO,dao,pldao,LO3B erichtDAOTarget,LO3BerichtDAO,USI,messagesender,jm sTemplate,jmsConnectionFactory,exporter,lo3idvmbea
n]; root of BeanFactory hierarchy}
08:56:22,308 INFO [LocalSessionFactoryBean] Closing Hibernate SessionFactory
08:56:22,308 INFO [SessionFactoryImpl] closing
08:56:22,308 ERROR [SpgServiceLocator] Error initializing Spring ApplicationContext
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in class path resource [config/applicationCo
ntext-ejb.xml]: Initialization of bean failed; nested exception is javax.management.InstanceAlreadyExistsException: bean:name=LO3IDVProcess already re
gistered.
javax.management.InstanceAlreadyExistsException: bean:name=LO3IDVProcess already registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.ad d(BasicMBeanRegistry.java:755)
at org.jboss.mx.server.registry.BasicMBeanRegistry.re gisterMBean(BasicMBeanRegistry.java:211)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
I can see my EJB being removed but why isn't the jmx bean removed? Does anyone know howto do this.
thanks,
Maarten