This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Please check the below code, I am receiving an error when I try to add a new client to the server.
It is always getting into the catch block and giving the below error "remote exception occurred in the server thread; nested exception is : java.rmi.unmarshalexception; error unmarshaling arguments; nested exception is: java.lang.classnotfoundexception: ServImp_Stub
So, as known from the error message, class ServImp_Stub is not found! Now, the next question would be "what the #$%^ is this class all about"
Stub classes are used by RMI to communicate between two JVMs. JDK 1.5 onwards you do not need to generate these classes instead RMI uses dynamic proxies to generate stubs at runtime for you. There are some ifs and buts that you can find out either by searching this forum or google.
If you are before JDK 1.5, then you need to generate the stub classes using rmic.
All I am trying to do in this class is to add the client details to the server. When I specify the name, password and the IP of the client and click on register, it is throwing the exception. I am using J2SDK1.4.2_18 version.
I understand that you are a beginner in java but unfortunately only thing i can help you in is to point you to an appropriate documentation to make you learn what is to be done. This is the tutorial for jdk 1.4 RMI and this section tells you how to use rmic to generate stubs for your server. Kindly go through the above links and try to understand RMI a little, otherwise you would not be able to get this going.