相关疑难解决方法(0)

java.rmi.ServerException:服务器线程中发生RemoteException(ClassNotFoundException)

以下方法:

private void startServer() { // snippet that starts the server on the local machine
    try {
         RemoteMethodImpl impl = new RemoteMethodImpl();
         Naming.rebind( "Illusive-Server" , impl );
    }catch(Exception exc) {
        JOptionPane.showMessageDialog(this, "Problem starting the server", "Error", JOptionPane.ERROR_MESSAGE);
        System.out.println(exc);
    }
}
Run Code Online (Sandbox Code Playgroud)

抛出此异常:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: Interfaces.RemoteMethodIntf

当我启动我的项目时,我会收到JOptionPane中的消息,说服务器启动服务器然后出现上述异常.这可能是什么原因?

我不明白为什么最后一个异常声明说当我导入了正确的包时没有找到类

java rmi exception

8
推荐指数
2
解决办法
5万
查看次数

标签 统计

exception ×1

java ×1

rmi ×1