I am new to springs I want expose my bean as rmi getting some exception
java.rmi.ConnectException: Connection refused to host: 10.224.10.90; nested exception is:
java.net.ConnectException: Connection refused: connect
/************************************************** *******/
public class userClient {
public static void main(String[] args) throws Exception {
Test test =
(Test)Naming.lookup(
"rmi://<host>:1100/Test");
test.Name("HI Dude");
}
}
/*****************************8
public interface TestInterface {
public String Name(String Name);
}
/*********************************************
public class Test implements TestInterface {
public Test() {}
public String Name(String name){
System.out.println("Your name is "+name);
return name;
}
}
///**************************************************
and finally my config file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="test" class="Test">
</bean>
<bean class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="service">
<ref bean="test"/>
</property>
<property name="serviceName">
<value>Test</value>
</property>
<property name="serviceInterface">
<value>TestInterface</value>
</property>
<property name="registryPort">
<value>1100</value>
</property>
</bean>
</beans>
//
Thank in advance..
-Delhi


Reply With Quote