2

一开始我想声明 rmi 正在工作,当我没有配置 bean 以使用我的 remoteInvocationFactory 时。

我的结构:我有 2 个 Web 应用程序,都具有嵌入式 osgi 框架(Equinox 3.9),WebAppServer - 在其 osgi 内部,有一个捆绑包,将 osgi 服务导出为 rmi 服务,
WebAppClient - 在其 osgi 内部,有捆绑包,消耗rmi 服务

两个 webapps 都使用 spring dm (gemini-blueprint 2.0.0.M02)

在 WebAppServer 中,我通过实例化RmiServiceExporter并调用 prepare() 来导出 rmi。

在客户端(WebAppClient),这就是我在包内定义 rmi 代理 bean 的方式

<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>

正如我之前所说,如果我想指定我的自定义远程调用工厂,我可以成功调用该服务,问题就开始了:

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

工厂提供MyCustomRemoteInvocation

现在,当我调用服务时,我得到

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)

我不想启用 rmi 类加载器,缺少的类在服务实现中可用,(它由安装在 osgi 框架中的包导出),我尝试在其他地方导入它,但没有运气,有什么想法吗?

4

0 回答 0