Error Occurred In Server Thread Nested Exception Is Java.lang.noclassdeffounderror
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException) up vote 3 down vote favorite 2 The following method : 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); } } throws this exception :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 When i start my project, i am greeted with the message in JOptionPane saying problem starting the server and then the above exception. What could be the reason for this ? I don't understand why does the last statement of exception says class not found exc when i have imported the right packages java exception rmi share|improve this question edited Mar 31 '15 at 0:08 EJP 197k17140249 asked Mar 2 '12 at 9:52 Suhail Gupta 6,26938105190 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted There are three cases of this exception. When exporting: you didn't run 'rmic' and you didn't take the steps described in the preamble to the Javadoc for UnicastRemoteObject to make it unnecessary. When binding: the Registry doesn't have the stub or the remote interface or something they depend on on its classpath. when looking up: the client does't have these things on
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us http://stackoverflow.com/questions/9531158/java-rmi-serverexception-remoteexception-occurred-in-server-thread-classnotfou Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up RMI http://stackoverflow.com/questions/3629568/rmi-server-exception Server Exception up vote 3 down vote favorite 1 I am getting below exception from RMI when I try to run a Server which uses a remote registry. My registry cod for the main method in Server2 class is Registry registry = LocateRegistry.getRegistry("192.168.1.4",1100); registry.rebind("Hello",stub); 192.168.1.4 is another machine in the same LAN. Please help me. Server2 exception:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: example.Hello.RemoteHello2 java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: example.Hello.RemoteHello2 at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377) at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source) at e
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/21857968/why-java-rmi-serverexception-remoteexception-occurred-in-server-thread-shows of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: error occurred Sign up Why “java.rmi.ServerException: RemoteException occurred in server thread” shows? up vote 1 down vote favorite Why the following error is showing ? Error = java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: rmi.CalcIntf rmi share|improve this question asked Feb 18 '14 at 15:21 TomJ 36031629 add a comment| 1 Answer 1 active error occurred in oldest votes up vote 0 down vote accepted If you look at the entire stack trace, which you should have posted in your question, you will probably find that the error occurred in bind() or rebind(). That indicates that the Registry doesn't have the class mentioned on its CLASSPATH. Solution: either run the Regsistry with an appropriate CLASSPATH, or run it inside the server JVM via LocateRegistry.createRegistry(). share|improve this answer edited Feb 19 '14 at 5:55 answered Feb 18 '14 at 20:37 EJP 197k17140249 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged rmi or ask your own question. asked 2 years ago viewed 1527 times active 2 years ago Related 3java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException)0Java - working with rmi. getting java.rmi.UnmarshalException1Java RMI Remote Interface Tutorial
in Java J2EE I know how frustrating is to see Exception in thread "main" java.lang.NoClassDefFoundError,which is a manifestation of NoClassDefFoundError in Java. I have seen it a couple of times and spent quite a lot time initially to figure out what is wrong, which class is missing etc. The first mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality, they are totally different, and my second mistake was using trial and error method to solve this java.lang.NoClassDefFoundError instead of understanding why NoClassDefFoundError is coming, what is the real reason behind NoClassDefFoundError and how to resolve this. In this Java tutorial, I have tried to rectify that mistakes and uncover some secrets of NoClassDefFoundError in Java and will share my experience around it. NoClassDefFoundError is not something which cannot be resolved or hard to resolve it's just its manifestation which puzzles most of Java developer. This is the most common error in Java development along with java.lang.OutOfMemoroyError: Java heap space and java.lang.OutOfMemoryError: PermGen space Anyway lets's see Why NoClassDefFoundError comes in Java and what to do to resolve NoClassDefFoundError in Java. What is the reason of NoClassDefFoundError in Java? NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. For example, if we have a method call from a class or accessing any static member of a Class and that class is not available during run-time then JVM will throw NoClassDefFoundError. It's important to understand that this is different than ClassNotFoundException which comes while trying to load a class at run-time only and the name was prov