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

  • RMI Remoting Example

    Hi,
    I receive the following class not found exception when implementing the Rmi remoting examples in the 1.1.3 reference:
    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [server-service-context-test.xml]: Initialization of bean failed; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationWrapper_Stub
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationWrapper_Stub
    	at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352)
    	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
    	at sun.rmi.transport.Transport$1.run(Transport.java:148)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    	at java.lang.Thread.run(Thread.java:534)
    	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
    	at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    	at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:162)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:990)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:275)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:193)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:240)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
    
    ...
    I am running Spring 1.1.2, Java 1.4.2 (incl. rmiregistry).

    Can anyone help please?
    Thanks!!

  • #2
    RmiInvocationWrapper_Stub.class is contained in spring.jar, so your class loader should be able to find it...

    Have you tried to run JPetStore with the RMI exporter turned on(uncomment the RmiServiceExporter definition in /WEB-INF/applicationContext.xml)? This is what I always test before a release, and it always works...

    To access JPetStore's RMI service, uncomment the RmiProxyFactoryBean definition in samples/jpetstore/client/clientContext.xml and run client.bat/sh with an order id. However, you should already see whether the export works when the server starts up anyway.

    Juergen

    Comment


    • #3
      Hi ,

      Thanks for the help Juergen.

      I managed to get this to work by turning the registry off and the Spring infrastructure took care of it - by starting its own registry.

      I will try your suggestions.

      Thanks again.

      p.s Have you guys seen the openAMF project ? At this time we are assessing the use of the Spring integration (...SpringBeanInvoker) provided by this project. Flash MX -> Servlet Engine -> openAMF Gateway -> Spring. Have you done any investigation of this framework ? Any and all observations would be welcome. = )
      sinclair

      Comment


      • #4
        Registry Off

        What did you do to turn off the registry?

        Thanks,

        Sergey

        Comment


        • #5
          Same Error

          I am getting the same error.

          java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
          java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationWrap per_Stub

          But this only happens when I make the RMI Service fail and restart it. In this case I am relying on
          <property name="refreshStubOnConnectFailure" value="true"></property>

          Thanks,

          Sergey

          Comment


          • #6
            Another Error

            After I made sure spring jar is in the classpath I got following exception.

            java.lang.NoSuchMethodException: org.springframework.remoting.rmi.RmiInvocationWrap per_Stub.getScorexResults(net.lmb.scorex.realtime. adapter.ScorexPacketVO)

            "getScorexResults" is my method so it is definitely not going to be on the Spring Stub. It seems like a ClassLoader problem.

            Did anyone encounter similar problem?

            Thanks,

            Sergey

            Comment


            • #7
              run rmi using springframe in tomcat server, and it throw same error.i found my tomcat installed path include space, for example:
              C:\Program Files\Apache\Tomcat 5.5

              so i reinstall tomcat, the installed path chnage to have no any space, for example:
              c:\tomcat5

              the problem above exception did not throw.

              try it.

              Comment

              Working...
              X