Results 1 to 4 of 4

Thread: Unable to export more than one Service through RMI

  1. #1
    Join Date
    Apr 2010
    Posts
    5

    Default Unable to export more than one Service through RMI

    When i deploy a bundle which exports two services through RMI on bundle activation the following exception is raised:
    Code:
    Caused by: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
        java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.springsource.kernel.userregion.internal.equinox.KernelBundleClassLoader
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:227)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:286)
    I simply can't understand why a classloader has to be exported...

    The failure happens while rebinding the second service in the rmi registry:

    Code:
    RmiServiceExporter.prepare() {
    ...
    // Bind RMI object to registry.
    		try {
    			if (this.replaceExistingBinding) {
    				this.registry.rebind(this.serviceName, this.exportedObject);
    			}
    			...
    		}
    ...
    }
    Beside, even why does anything be serialized at that moment?

    When i deploy the bundle exporting one or the other but only one at the same time it does work!

    BTW, the same configuration (with two exported services) worked on dm Server 1.0.2.RELEASE!

    spring-context file:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    
    	<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        		<property name="serviceName" value="service1" />
        		<property name="service" ref="service1" />
        		<property name="serviceInterface" value="com.not.exists.service.IService" />
        	</bean>
        
    	<bean id="service1" class="com.not.exists.server.service.ServiceImpl" />
    	
    	<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        		<property name="serviceName" value="service2" />
        		<property name="service" ref="service2" />
        		<property name="serviceInterface" value="com.not.exists.service.IService" />
        	</bean>
        
    	<bean id="service2" class="com.not.exists.server.service.Service2" />
    </beans>

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Thanks for raising this as DMS-2491.
    Glyn Normington
    SpringSource

  3. #3
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

    We are also hit with the same issue.

    Is there any workaround for this untill its fixed ?

  4. #4
    Join Date
    Apr 2010
    Posts
    5

    Default additionally add "org.springframework.remoting.support"

    The solution is to additionally add "org.springframework.remoting.support" to the list of imported packages in the bundle manifest which exports the services.

    For more details consider DMS-2491.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •