【发布时间】:2009-09-29 18:26:53
【问题描述】:
我正在编写一个 rmi 应用程序。当我将所有类放在一个目录(一个单独的包)中时,一切正常。但是,当我尝试拆分服务器部分和客户端部分时,客户端会发生异常。服务器正常工作。 以下是异常发生后的部分堆栈跟踪:
Exception in thread "main"
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.clientpackage.ClientImpl_Stub (no security manager: RMI class loader disabled)
我使用 unicastRemoteobject 方法将来自客户端的对象实例传递给服务器以进行回调。我还使用 rmic 为对象生成存根文件。似乎该程序在其 CLASSPATH 上找不到该存根类。我想知道如何解决这个问题?
【问题讨论】:
-
你能解决这个问题吗?