Hello!
I'm trying to set up MX4J in an OC4J-container using Spring and run into some problems. The configuration I'm using looks like this:
This configuration works just fine when I try it locally in my own IDE. When I try run it in the container i get a number of different exceptions. By just adding the RmiRegistryFactoryBean I get the following exception:Code:<beans> <bean id="rmiregistry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"> <property name="port" value="9999"/> </bean> <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"/> <bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"> <property name="objectName" value="connector:name=rmi"/> <property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:9999/jmxconnector"/> </bean> <bean id="JmxService" class="..."/> <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"> <property name="beans"> <map> <entry key="csam:service=JmxService"> <ref local="JmxService"/> </entry> </map> </property> </bean> </beans>
(10.14.10.112 is the ip-address of the computer I'm working on).Code:java.rmi.ConnectException: Connection refused to host: 10.14.10.112; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171) at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313) at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source) at org.springframework.remoting.rmi.RmiRegistryFactoryBean.testRegistry(RmiRegistryFactoryBean.java:238) at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:217) at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:200) at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:164) at org.springframework.remoting.rmi.RmiRegistryFactoryBean.afterPropertiesSet(RmiRegistryFactoryBean.java:135) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:81) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at no.rikshospitalet.csam.core.service.framework.SpringAssistant.createApplicationContext(SpringAssistant.java:34) at...
When I run the whole configuration, then I also get the following error after the one above:
Has anyone made this combination work? The strange thing is also that there is something listening on port 9999 when I run the code, but still isn't able to connect for some strange reason.Code:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [spring-jmx-config.xml]: Initialization of bean failed; nested exception is javax.management.RuntimeOperationsException: Exception occured in ModelMBeanOperationInfo setDescriptor javax.management.RuntimeOperationsException: Exception occured in ModelMBeanOperationInfo setDescriptor at javax.management.modelmbean.ModelMBeanOperationInfo.setDescriptor(ModelMBeanOperationInfo.java:395) at org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler.getOperationInfo(AbstractReflectiveMBeanInfoAssembler.java:285) at org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler.getMBeanInfo(AbstractMBeanInfoAssembler.java:68) at org.springframework.jmx.export.MBeanExporter.getMBeanInfo(MBeanExporter.java:617) at org.springframework.jmx.export.MBeanExporter.registerSimpleBean(MBeanExporter.java:516) at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:467) at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:441) at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:368) at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:312) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:81) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at...
Regards,
Bjorn Vidar Boe


Reply With Quote