JMX-RMI problem
This question is a bit long, but I hope you'll hang in there with me, because I've Googled around a bit and I'm not sure where to go next. It looks like we're having a problem with the RMI server in conjunction with JMX. Here's what happened:
One of our QA folks was using my Spring and JMX-enabled application, hosted on a VMWare virtual machine. Things were fine. Then he took his laptop home, connected the computer through his wireless router, and worked from home. When he came back to the office, he had to release his router's IP address and renew his IP with our network. At that point, my application wouldn't start correctly. When we examined the logs, we found the following:
[exception:BeanCreationException][reason:Error creating bean with name'connectorServer' defined inclass path resource
[proxyServerContext-jmx.xml]: Initialization of bean failed; nested exception is java.io.IOException: Cannot bind to URL
[rmi://10.22.2.61:5000/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException:
Connection refused to host: 10.22.2.61; nested exception is:
java.net.ConnectException: Connection timed out: connect]][stack trace:
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:370)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
...
Here's what my JMX/Spring configuration looks like:
<!DOCTYPE beans PUBLIC"-//SPRING//DTD BEAN//EN""http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean class="org.springframework.jmx.support.MBeanServerFactoryBean"/>
<!-- Configure the RMI Registry -->
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
<property name="port" value="5000"/>
</bean>
<!-- Configure the Connector -->
<bean id="connectorServer" class="org.springframework.jmx.support.ConnectorServerFactoryBean">
<property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:5000/jmxrmi"/>
</bean>
<bean id="exporter"
class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="VL3 Proxy Server:type=monitoring,name=Statistics" value-ref="theStatistician"/>
<entry key="VL3 Proxy Server:type=configuration,name=StartUpConfig" value-ref="startUpConfig"/>
<entry key="VL3 Proxy Server:type=control,name=Control" value-ref="control"/>
</map>
</property>
</bean>
...
</beans>
I'd be grateful for your assistance...
Thanks,
Steve

