0

I created a RMI Client and Server for my Java class. The programs where placed in their respective packages.

Result: The server used to get compiled correctly, on compiling the Cilent it gives an error

java.rmi.UnmarshalException: error unmarshalling return; nested exception is:

To my surprise the program worked perfectly fine when, the same program was placed in default folder of respective packages.

Now my question is Why is such behavior?. And how do I compile the program when they are placed in packages? Do leave me your comments..

Updated...

Error

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: com.Ejb.Server.HelloService (no security manager: RMI class loader disabled) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at com.Ejb.Client.HelloClient.main(HelloClient.java:16) Caused by: java.lang.ClassNotFoundException: com.Ejb.Server.HelloService (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source) at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source) at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source) at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source) at java.io.ObjectInputStream.readProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) ... 2 more

User27854
  • 824
  • 1
  • 16
  • 40
  • And the nested exception is... – Luiggi Mendoza Jun 13 '14 at 14:28
  • I don't think you mean 'compiled', I think you mean run and what's the `nested exception` - that should tell you the problem. Please include the full stack-trace – Nick Holt Jun 13 '14 at 14:29
  • Ho, sorry I have updated the post now. @NickHolt, I meant Run :) – User27854 Jun 13 '14 at 14:32
  • I have referred to the link that was given (marked as duplicated but its of no use). In my case, the server App(.java file) and the client App(.java file) where stored in packages having different names. Once i corrected it(both having same name).. It was working fine. – User27854 Jul 03 '14 at 08:39

0 Answers0