[英]Java RMI NoClassDefFoundError (development on Netbeans IDE)
I'm a student, and I'm trying to write an RMI application. 我是一名学生,并且正在尝试编写RMI应用程序。
I have 3 separate projects: 我有3个独立的项目:
and I write it on Netbeans IDE. 我是在Netbeans IDE上编写的。
When I start server I receive a printstack error like this: 当我启动服务器时,我收到如下的打印堆栈错误:
Exception in thread "main" java.lang.NoClassDefFoundError: rmi/cosmetic/Interfaces/ICategories
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at Server.ServerSide.main(ServerSide.java:22)
Caused by: java.lang.ClassNotFoundException: rmi.cosmetic.Interfaces.ICategories
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 13 more
Java Result: 1
rmi/cosmetic/Interfaces/ICategories rmi / cosmetic / Interfaces / ICategories
is the path of file Interface Categories, it has been contained in Common Project for both of 2 sides client and server 是文件接口类别的路径,包含在两个客户端和服务器的Common Project中
I have no idea about this issue. 我不知道这个问题。 I try to set classpath on my windows but it didn't work. 我尝试在Windows上设置类路径,但是它不起作用。
Can someone please help me? 有人可以帮帮我吗?
Some images, to make it clear 一些图像,以使其清晰
http://upanh.7nghiep.com/vgo-images/vgo.vn-qIntT.jpg http://upanh.7nghiep.com/vgo-images/vgo.vn-qIntT.jpg
http://upanh.7nghiep.com/vgo-images/vgo.vn-jaJw0.jpg http://upanh.7nghiep.com/vgo-images/vgo.vn-jaJw0.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-RvxIo.jpg upanh.7nghiep.com/vgo-images/vgo.vn-RvxIo.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-DvuMt.jpg upanh.7nghiep.com/vgo-images/vgo.vn-DvuMt.jpg
upanh.7nghiep.com/vgo-images/vgo.vn-OI9rL.jpg upanh.7nghiep.com/vgo-images/vgo.vn-OI9rL.jpg
Caused by: java.lang.ClassNotFoundException: rmi.cosmetic.Interfaces.ICategories 引起原因:java.lang.ClassNotFoundException:rmi.cosmetic.Interfaces.ICategories
There's your problem right there. 那里有你的问题。 Your Registry or your client can't find that class. 您的注册表或客户找不到该类。 It needs to be on their CLASSPATH. 它必须在其CLASSPATH上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.