Как запустить Spring RMI Server? - PullRequest
       10

Как запустить Spring RMI Server?

0 голосов
/ 16 апреля 2019

Я получаю сообщение об ошибке при попытке запустить сервер rmi spring.

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:

На сервере я написал это в xml-файле

<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>

А у клиента

<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>

При запуске сервера я использовал

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

Все, что я делаю, это запускаю сервер, но я получаю эту ошибку. Спасибо за любую помощь!

...