Spring Framework
  1. Spring Framework
  2. SPR-6208

RmiInvocationWrapper Stubs and Skels not packaged in org.springframework.remoting.rmi package

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0 M2, 3.0 M3, 3.0 M4, 3.0 RC1
    • Fix Version/s: 3.0 RC3
    • Component/s: Remoting
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      We have RMI services exposed using Spring 2.5.6 RmiServiceExporter and currenly developing clients which will consume these services, but using Spring 3.0 RmiProxyFactoryBean.

      org.springframework.remoting.rmi.RmiInvocationWrapper_Skel.class and org.springframework.remoting.rmiRmiInvocationWrapper_Stub.class are not found in spring-context module in Spring 3.0 jars

      This causes class not found exceptions on client RMI calls.

      We fixed it temporarily by using our custom Spring 3 build, changing the org.springframework.context/build.xml to overrire do-compile macro (with rmic calls included)

      <project name="org.springframework.context" xmlns:s="antlib:org.springframework.build">
              <property file="${basedir}/../build.properties"/>
              <import file="${basedir}/../build-spring-framework/package-bundle.xml"/>
              <import file="${basedir}/../spring-build/standard/default.xml"/>
       
      	<macrodef name="do-compile">
      		<attribute name="classpath.id"/>
      		<attribute name="input.dir"/>
      		<attribute name="output.dir"/>
      		<attribute name="resources.dir"/>
      		<sequential>
      			<s:javac destdir="@{output.dir}" source="${source.version}" target="${target.version}"
      					debug="${compile.debug}" debugLevel="${compile.debug.level}">
      				<compilerarg line="${compiler.args}"/>
      				<src path="@{input.dir}"/>
      				<include name="**/*.java"/>
      				<include name="*.java"/>
      				<classpath refid="@{classpath.id}"/>
      			</s:javac>
      	
      			<rmic base="@{output.dir}" classname="org.springframework.remoting.rmi.RmiInvocationWrapper"/>
      	
      			<rmic base="@{output.dir}" classname="org.springframework.remoting.rmi.RmiInvocationWrapper" iiop="true">
      				<classpath refid="@{classpath.id}"/>
      			</rmic>
      	
      			<copy todir="@{output.dir}">
      				<fileset dir="@{input.dir}">
      					<exclude name="**/*.java"/>
      					<exclude name="*.java"/>
      				</fileset>
      			</copy>
      			<copy todir="@{output.dir}">
      				<fileset dir="@{resources.dir}"/>
      			</copy>
      		</sequential>
          </macrodef>
      
      </project>
      
      1. build.xml
        2 kB
        Aleksa Vukotic

        Activity

        Hide
        Aleksa Vukotic added a comment -

        changed org.springframework.context/build.xml file

        Show
        Aleksa Vukotic added a comment - changed org.springframework.context/build.xml file
        Hide
        Arjen Poutsma added a comment -

        Formatting

        Show
        Arjen Poutsma added a comment - Formatting
        Hide
        Thomas Risberg added a comment -

        This is only a problem if the server is using Spring 2.5.6 while the client is using Spring 3.0. Simply adding the RmiInvocationWrapper_Stub class from 2.5.6 to the clients classpath resolved the issue in my tests.

        Show
        Thomas Risberg added a comment - This is only a problem if the server is using Spring 2.5.6 while the client is using Spring 3.0. Simply adding the RmiInvocationWrapper_Stub class from 2.5.6 to the clients classpath resolved the issue in my tests.
        Hide
        Thomas Risberg added a comment -

        The recommended fix is to upgrade the server to Sprung 3.0 as well. If this is not possible, including the RmiInvocationWrapper_Stub class from 2.5.6 on the clients classpath solves the problem.

        This is more of a documentation issue - I will include this in the "Migration Guide" and will also show a script that can be used to create a "compatibility" jar to be used in a client application using Spring 3.0 when the server application is still using 2.5.6.

        Show
        Thomas Risberg added a comment - The recommended fix is to upgrade the server to Sprung 3.0 as well. If this is not possible, including the RmiInvocationWrapper_Stub class from 2.5.6 on the clients classpath solves the problem. This is more of a documentation issue - I will include this in the "Migration Guide" and will also show a script that can be used to create a "compatibility" jar to be used in a client application using Spring 3.0 when the server application is still using 2.5.6.
        Hide
        Thomas Risberg added a comment -

        Added a section to the migration guide

        Show
        Thomas Risberg added a comment - Added a section to the migration guide
        Hide
        Radim Tlusty added a comment -

        The absence of the stubs has consequence also for the opposite situation = Spring 3.0.0 on server and older Spring on client. In our use case we need it for our mobile clients (Windows mobile), which can't use Java 1.5 and Spring 3.0.

        When I have connected to server based on Java 1.5/Spring 3.0.0 from client on Java 1.4.2/Spring 2.5.6 I've got following error:

        org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException:   error unmarshalling return; nested exception is: 
        	java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled)
        	at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:214)
        	at org.springframework.remoting.rmi.RmiClientInterceptor.prepare(RmiClientInterceptor.java:146)
        	at org.springframework.remoting.rmi.RmiClientInterceptor.afterPropertiesSet(RmiClientInterceptor.java:134)
        	at org.springframework.remoting.rmi.RmiProxyFactoryBean.afterPropertiesSet(RmiProxyFactoryBean.java:67)
        	at gk.spring_remoting.client.Client.createRmiService(Client.java:25)
        	at gk.spring_remoting.client.Client.performTest(Client.java:50)
        	at gk.spring_remoting.client.Client.main(Client.java:62)
        Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
        	java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled)
        	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        	at java.rmi.Naming.lookup(Naming.java:84)
        	at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:199)
        	... 6 more
        Caused by: java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled)
        	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
        	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
        	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
        	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
        	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
        	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
        	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
        	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
        	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
        	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
        	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
        	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
        	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
        	... 9 more}
        

        When I have added the RmiInvocationWrapper_Stub.class from Spring 2.5.6 to the server side classpath it works.

        Can you please consider again to add this stub classes to the Spring 3.0 distribution for backward compatibility?

        Show
        Radim Tlusty added a comment - The absence of the stubs has consequence also for the opposite situation = Spring 3.0.0 on server and older Spring on client. In our use case we need it for our mobile clients (Windows mobile), which can't use Java 1.5 and Spring 3.0. When I have connected to server based on Java 1.5/Spring 3.0.0 from client on Java 1.4.2/Spring 2.5.6 I've got following error: org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled) at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:214) at org.springframework.remoting.rmi.RmiClientInterceptor.prepare(RmiClientInterceptor.java:146) at org.springframework.remoting.rmi.RmiClientInterceptor.afterPropertiesSet(RmiClientInterceptor.java:134) at org.springframework.remoting.rmi.RmiProxyFactoryBean.afterPropertiesSet(RmiProxyFactoryBean.java:67) at gk.spring_remoting.client.Client.createRmiService(Client.java:25) at gk.spring_remoting.client.Client.performTest(Client.java:50) at gk.spring_remoting.client.Client.main(Client.java:62) Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Naming.java:84) at org.springframework.remoting.rmi.RmiClientInterceptor.lookupStub(RmiClientInterceptor.java:199) ... 6 more Caused by: java.lang.ClassNotFoundException: java.rmi.server.RemoteObjectInvocationHandler (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) ... 9 more} When I have added the RmiInvocationWrapper_Stub.class from Spring 2.5.6 to the server side classpath it works. Can you please consider again to add this stub classes to the Spring 3.0 distribution for backward compatibility?
        Hide
        Liam Knox added a comment -

        Is this actually resolved as I see the same ClassNotFoundException for org.springframework.remoting.rmiRmiInvocationWrapper_Stub.class when connection from a Spring 3.0.2 client to a 2.5.6 server?

        Show
        Liam Knox added a comment - Is this actually resolved as I see the same ClassNotFoundException for org.springframework.remoting.rmiRmiInvocationWrapper_Stub.class when connection from a Spring 3.0.2 client to a 2.5.6 server?

          People

          • Assignee:
            Thomas Risberg
            Reporter:
            Aleksa Vukotic
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 42 weeks, 6 days ago