测试rmi注册时 报错
java.rmi.StubNotFoundException: Stub class not found: server.TaskRemoteImp_Stub; nested exception is:
java.lang.ClassNotFoundException: server.TaskRemoteImp_Stub
at sun.rmi.server.RemoteProxy.getStub(RemoteProxy.java:98)
at sun.rmi.server.RemoteProxy.getStub(RemoteProxy.java:55)
at sun.rmi.server.UnicastServerRef.setSkeleton(UnicastServerRef.java:179)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:142)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:61)
at server.TaskRemoteImp.<init>(TaskRemoteImp.java:13)
at rmiMain.main(rmiMain.java:16)
Caused by: java.lang.ClassNotFoundException: server.TaskRemoteImp_Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at sun.rmi.server.RemoteProxy.loadClassFromClass(RemoteProxy.java:191)
at sun.rmi.server.RemoteProxy.getStub(RemoteProxy.java:93)
... 10 more
Exception in thread "main"
报错 。。。。。。。。
和你的写法一致 jdk1.4
怎么解决呢??
回复 更多评论