Problem with the registryHost property
Hi all,
I try to bind a object in specific host, I have the following error:
Exception in server - main -> org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExport er#0' defined in class path resource [beans/communication/server/rmi.xml]: Invocation of init method failed; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
at tarenal.rootserver.Factory.beginServerCommunicatio n(Factory.java:14)
at tarenal.rootserver.Server.initializeServer(Server. java:287)
at tarenal.rootserver.Server.<init>(Server.java:105)
at tarenal.rootserver.Server.main(Server.java:704)
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknow n Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection( Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unk nown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source)
at org.springframework.remoting.rmi.RmiServiceExporte r.testRegistry(RmiServiceExporter.java:411)
at org.springframework.remoting.rmi.RmiServiceExporte r.getRegistry(RmiServiceExporter.java:326)
at org.springframework.remoting.rmi.RmiServiceExporte r.prepare(RmiServiceExporter.java:263)
at org.springframework.remoting.rmi.RmiServiceExporte r.afterPropertiesSet(RmiServiceExporter.java:227)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1335)
... 18 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.cre ateSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.cre ateSocket(Unknown Source)
... 29 more
The .xml file is the next:
<bean id="rmiAdminCommunication" class="tarenal.rootserver.Server" factory-method="getInstanceAdministration"/>
<bean class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="service" ref="rmiAdminCommunication"/>
<property name="serviceName" value="rmi_admin"/>
<property name="serviceInterface" value="tarenal.communication.RootServerAdminCommun ication"/>
<property name="registryHost" value="${rootserver.ip}"/>
<property name="registryPort" value="${rootserver.rmi.port}"/>
<property name="servicePort" value="${rootserver.rmi.port}"/>
</bean>