Hi all
i am trying to expose some of my spring integ functionality via RMI
i have checked apidocs for RmiInboundGAtway, and what i am trying to do is to define an inbound gateway for receiving messges and an outbound for posting them
here's my config file
I am getting this exceptionCode:<bean id="rmiOutGateway" class="org.springframework.integration.rmi.RmiOutboundGateway"> <constructor-arg value="rmi://localhost:12345"/> <property name="replyChannel" ref="replies"/> </bean> <bean id="rmiInGateway" class="org.springframework.integration.rmi.RmiInboundGateway"> <property name="registryHost" value="localhost"/> <property name="registryPort" value="12345"/> <property name="requestChannel" ref="requests"/> </bean>
Code:Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rmiInGateway' defined in class path resource [rmi-server-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: failed to initialize; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) at com.sample.services.SIStartUp.main(SIStartUp.java:18) Caused by: org.springframework.beans.factory.BeanInitializationException: failed to initialize; nested exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ... 12 more Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
My guess is that if i want to use the RMI adapter, i have to configure an RMI server using RmiServiceExporter. Is that correct?
could anyone point me to a spring integ rmi sample, as i was unable to find it?
w/kindest regards
marco


Reply With Quote