This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am getting the following error when trying to run client: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException : suncertify.server.FBNConnectionFactoryImpl_Stub(no security manager:RMI class loader disabled) ---> I copied the stubs into client.jar but still getting the error. This error goes away if I include server.jar in the class-path of client manifest file. Is it OK to have the class-path of client manifest to have server.jar? Any help appreciated? Thanks.
Thanks for the response Mark! But this is my situation... I am not using any server classes other than the FBNConnectionFactory interface in client. I put it in common.jar which is in the Class-Path of both server.jar an client.jar. RMIC'd 2 classes in server and copied the stubs to client and then jarred client and server. If I include server.jar in the class-path of manifest then its getting the stubs from suncertify\server directory and there is no problem.(In this case i am not copying the stubs into client directory) I am wondering since the package declaration in stubs is "suncertify.server", and since they are in the client.jar its giving this problem. How should I take care of this problem? I am not accessing any files other than the above interface in the client and the client accesses that interface thru common.jar in the class-path. Thanks Mark!!
Hmm, it still seems to need a class that is in the server.jar that is not in any of your other jars. Not much else that I can think of to offer as suggestions. Myself, I only had two jars server.jar and client.jar and that worked fine. Mark
Joined: Apr 01, 2003
I double checked it and I don't have any import in client classes that access server classes and even then shouldn't it give a compile error?...why is it giving me the above error when running....This is frustrating me!! why is it saying stub class not found...when I copied the stub into client directory? I looked into the client.jar and its there. Mark...Do you think its unacceptable to include server.jar in class-path of manifest of client. Thanks.
"Mark...Do you think its unacceptable to include server.jar in class-path of manifest of client." The only reason why I would say yes is because in local mode there is no server. I couldn't really say how the assessors would react to it being in the manifest, or if they will even check the manifest. I understand how frustrating it can be. One last idea. when your client does a lookup, is it casting the return to the interface? Mark
Joined: Apr 01, 2003
Mark..yes its casting to the interface. I put the stubs in stubs.jar and had them in the manifest class-path of client and its working now. The problem was that the directory structure didn't reflect the package declaration in stubs. I was so stupid I missed it and wasted a lot of time. Thanks Mark.
It happens all the time to me. This simple bugs are always the ones that seem to last for days. Especially those single character errors like missing a semi-colon. Now in Java luckily the compiler tells you this one quickly. But in the old days, compilers like the one for pascal wouldn't show you the bug, and you could literally spend days and not see that you missed a semi-colon. Mark