Announcement Announcement Module
Collapse
No announcement yet.
RmiServiceExporter exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RmiServiceExporter exception

    hi, i use code sample in pro-spring, chp16.
    if i set serviceUrl=localhost and both server and client code run locally(on one machine), client code can access romote service. but if i try to run them on two different machine, i got error as:
    java.io.InvalidClassException: org.springframework.remoting.support.RemoteInvocat ion; local class incompatible: stream classdesc serialVersionUID = 6876024250231820554, local class serialVersionUID = -7379940429104417144


    client xml file as followings:
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean id="helloWorldService" class="org.springframework.remoting.rmi.RmiProxyFa ctoryBean">
    <property name="serviceUrl">
    <value>rmi://179.31.168.173:9000/HelloWorld</value>
    </property>
    <property name="serviceInterface">
    <value>com.apress.prospring.ch16.remoting.HelloWor ld</value>
    </property>
    </bean>

    <bean id="helloWorldClient" class="com.apress.prospring.ch16.remoting.rmi.Hell oWorldClient">
    <property name="helloWorldService">
    <ref local="helloWorldService"/>
    </property>
    </bean>
    </beans>

    could sb meet the same problem? and how to fix it? thanks!

  • #2
    Try using the same version of the Spring jars on your second machine.

    Sanjiv
    Last edited by sjivan; Jun 21st, 2006, 11:40 PM.

    Comment


    • #3
      thanks a lot.

      Comment


      • #4
        Running the same example, yet having a different problem

        I'm studying the same example from "Pro Spring" . If I run both client and server on the same machine, everything's ok, here is the print out from the server application:
        Code:
        信息: Looking for RMI registry at port '1099'
        Host Started...
        2006-6-28 15:25:22 org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
        信息: CGLIB2 available: proxyTargetClass feature enabled
        2006-6-28 15:25:22 org.springframework.remoting.rmi.RmiServiceExporter afterPropertiesSet
        信息: Binding RMI service 'HelloWorld' to registry at port '1099'
        And here is the print out from the client application running on the same machine with the server application:
        Code:
        2006-6-28 15:33:27 org.springframework.remoting.rmi.RmiClientInterceptor prepare
        信息: RMI stub [rmi://172.16.6.108:1099/HelloWorld] is an RMI invoker
        Hello World
        Yet when I run the client application on another machine, i got following exception:
        Code:
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorldService' defined in class path resource [rmi/HellowWorldClient.xml]: Initialization of bean failed; nested exception is java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is: 
        	java.net.ConnectException: Connection timed out: connect
        java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is: 
        	java.net.ConnectException: Connection timed out: connect
        	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
        	at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
        	at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
        Can somebody please tell me what's going wrong here?
        Thanks very much.

        Comment


        • #5
          Running the same example, yet having a different problem

          I'm studying the same example from "Pro Spring" . If I run both client and server on the same machine, everything's ok, here is the print out from the server application:
          Code:
          信息: Looking for RMI registry at port '1099'
          Host Started...
          2006-6-28 15:25:22 org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
          信息: CGLIB2 available: proxyTargetClass feature enabled
          2006-6-28 15:25:22 org.springframework.remoting.rmi.RmiServiceExporter afterPropertiesSet
          信息: Binding RMI service 'HelloWorld' to registry at port '1099'
          And here is the print out from the client application running on the same machine with the server application:
          Code:
          2006-6-28 15:33:27 org.springframework.remoting.rmi.RmiClientInterceptor prepare
          信息: RMI stub [rmi://172.16.6.108:1099/HelloWorld] is an RMI invoker
          Hello World
          Yet when I run the client application on another machine, i got following exception:
          Code:
          org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorldService' defined in class path resource [rmi/HellowWorldClient.xml]: Initialization of bean failed; nested exception is java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is: 
          	java.net.ConnectException: Connection timed out: connect
          java.rmi.ConnectException: Connection refused to host: 172.16.6.108; nested exception is: 
          	java.net.ConnectException: Connection timed out: connect
          	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
          	at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
          	at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
          Can somebody please tell me what's going wrong here?
          Thanks very much.

          Comment

          Working...
          X