0

I get the error when trying to run the rmi spring server.

16 Apr 2019 16:48:16,318 DEBUG org.springframework.remoting.rmi.RmiServiceExporter 394 getRegistry - Looking for RMI registry at port '1099'
16 Apr 2019 16:48:17,588 TRACE org.springframework.remoting.rmi.RmiServiceExporter 404 getRegistry - RMI registry access threw exception
java.rmi.ConnectException: Connection refused to host: 192.168.56.1; nested exception is:

On the server I wrote this in the xml file

<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="serviceName" value="Chat"/>
        <property name="service" ref="AgencyServerImpl"/>
        <property name="serviceInterface" value="agencyServices.IAgencyServer"/>
        <property name="servicePort" value="1099"/>

    </bean>

And at the client

<bean id="AgencyServerImpl" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
        <property name="serviceUrl" value="rmi://192.168.56.1:1099/Chat"/>
        <property name="serviceInterface" value="agencyServices.IAgencyServer"/>
    </bean>

At the Server Start I used the

System.setProperty("java.rmi.server.hostname", "192.168.56.1");
        ApplicationContext context = new ClassPathXmlApplicationContext("serverBeans.xml");

Everything I do is to start the server, but I get that error. Thank you for any help!

Mary
  • 103
  • 2
  • 11

0 Answers0