OSGi + Spring DM + RMI custom RemoteInvocation ClassNotFound

313 views Asked by At

at the beginning i want to state that rmi is working, when i am not configuring bean to use my remoteInvocationFactory.

My structure: i have 2 web applications, both with embedded osgi framework (equinox 3.9), WebAppServer - inside its osgi, there is a bundle, that exports osgi services as rmi services,
WebAppClient - inside its osgi, there are bundles, that consumes rmi services

both webapps are using spring dm (gemini-blueprint 2.0.0.M02)

in WebAppServer i'am exporting rmi by instantiating RmiServiceExporter and calling prepare() on it.

on the client side (WebAppClient), thats how i define rmi proxy bean, inside bundles

<bean id="authorizationService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean" scope="prototype">
    <property name="serviceUrl" value="rmi://localhost:1099/xxx/AuthorizationService"/>
    <property name="serviceInterface" value="xxx.AuthorizationService"/>
    <property name="refreshStubOnConnectFailure"><value>true</value></property>
    <property name="lookupStubOnStartup"><value>false</value></property>
</bean>

as i stated before, i could successfully invoke that service, problem starts, if i want to specify my custom remote invocation factory:

<property name="remoteInvocationFactory"><ref bean="remoteInvocationFactory"/></property>

factory provides MyCustomRemoteInvocation

now, when i am invoking service, i get

Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: xxx.MyCustomRemoteInvocation cannot be found by org.springframework.context_3.2.3.RELEASE (no security manager: RMI class loader disabled)

i dont want to enable rmi class loader, missing class is available in service implementation, (its exported by bundle installed in osgi framework), i have tried importing it in other places, but no luck, any ideas ?

0

There are 0 answers