nkaranuk
Dec 29th, 2005, 02:38 AM
Hello,
I had to make Spring managed MBeans accessible thru Jboss's jmx-console and so used following conf
---applicationContext.xml---
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=TestMBean"> <ref bean="testBean" /></entry>
</map>
</property>
</bean>
<bean id="testBean" class="com.acme.Test"/>
Has bellow in the web.xml
<listener> <listener-class>org.springframework.web.context.ContextLoaderListe ner</listener-class>
</listener>
but when the war is deployed get stack trace
2005-12-29 13:01:22,730 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
at org.springframework.jmx.support.JmxUtils.locateMBe anServer(JmxUtils.java:81)
at org.springframework.jmx.support.JmxUtils.locateMBe anServer(JmxUtils.java:63)
at org.springframework.jmx.export.MBeanExporter.regis terBeans(MBeanExporter.java:332)
at org.springframework.jmx.export.MBeanExporter.after PropertiesSet(MBeanExporter.java:312)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
Plz let me know if i'm making some configurations mistake,as per http://blogs.warwick.ac.uk/chrismay/entry/spring_jmx_integration/ the conf does seem right.
looking forward for ur thoughts,
nkaranuk
I had to make Spring managed MBeans accessible thru Jboss's jmx-console and so used following conf
---applicationContext.xml---
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=TestMBean"> <ref bean="testBean" /></entry>
</map>
</property>
</bean>
<bean id="testBean" class="com.acme.Test"/>
Has bellow in the web.xml
<listener> <listener-class>org.springframework.web.context.ContextLoaderListe ner</listener-class>
</listener>
but when the war is deployed get stack trace
2005-12-29 13:01:22,730 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
org.springframework.jmx.MBeanServerNotFoundExcepti on: Unable to locate an MBeanServer instance
at org.springframework.jmx.support.JmxUtils.locateMBe anServer(JmxUtils.java:81)
at org.springframework.jmx.support.JmxUtils.locateMBe anServer(JmxUtils.java:63)
at org.springframework.jmx.export.MBeanExporter.regis terBeans(MBeanExporter.java:332)
at org.springframework.jmx.export.MBeanExporter.after PropertiesSet(MBeanExporter.java:312)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
Plz let me know if i'm making some configurations mistake,as per http://blogs.warwick.ac.uk/chrismay/entry/spring_jmx_integration/ the conf does seem right.
looking forward for ur thoughts,
nkaranuk