java.rmi.UnmarshalException : error unmarshalling arguments; nested exception is: java. lang.ClassNotFoundException:ServicesTableau

标签 java rmi

关于 JAVA RMI,我需要你的帮助,我开发了一个用于对表进行排序的示例程序。但我得到了这个异常(exception):

Erreur RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: ServicesTableau

这是我的服务器源代码:

public class Serveur {
    public static void main(String args[]) {

        try {

            System.out.println("Server start ...");
            ServicesTableauImpl od = new ServicesTableauImpl();
            String url = "rmi://" + args[0] + "/ServicesTableauImpl";
            System.out.println("Passe");
            Naming.rebind(url, od);
            System.out.println("Attente d'invocations de client / CTRL-C pour stopper");
        } catch (Exception e) {
            System.out.println("Erreur " + e.getMessage());
        }
    /*
    catch(java.net.MalformatedURLException e){
    System.out.println("Mauvais nom de serveur");
    System.exit(1);
    }
    catch(RemoteException e){
    System.out.println("Pas de Rmiregistry");
    System.exit(1);
    }
    */
    }
}

最佳答案

该类在 RMI 注册表的 CLASSPATH 中不可用。修复它的最简单方法是通过 LocateRegistry.createRegistry() 在同一 JVM 中启动注册表。将结果存储在静态字段中。

关于java.rmi.UnmarshalException : error unmarshalling arguments; nested exception is: java. lang.ClassNotFoundException:ServicesTableau,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14071885/

相关文章:

java - Spring Data + MongoDB 无效引用错误

java - 比较比较器的实用程序

java - ANT 中无法识别的选项问题

java - 扩展Webdriver或Selenium2的click()方法计算网页响应

java - 使用 RMI 编写安全的 Java 代码

java - Rmi 错误 IllegalArgumentException、MarshalException

java - 如何在netbeans中进行RMI

java - 日期格式映射到 JSON Jackson

ssl - 如何使用 JBoss 6 在 RMIIO 流上启用加密

java/spring-在 org.springframework.context.support.AbstractApplicationContext 处获取 NoClassDefFoundError