aspose file tools*
The moose likes Distributed Java and the fly likes RMI Server problem, errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Server problem, errors" Watch "RMI Server problem, errors" New topic
Author

RMI Server problem, errors

Siamak Saarmann
Ranch Hand

Joined: Aug 21, 2004
Posts: 77
Hello,

I am sorry to bring this subject again (lots of people have asked the same thing but I was not able to solve my problem through those threads).

I have this problem with Sun's example. (from API reference)

1- I have compiled java implementaion and interface files ( javac Hello.java HelloImpl.java )
2- I have run rmic ( rmic HelloImpl ) and I have my stub and skeleton class files
3- The directory which contains all these files is on my CLASSPATH.
4- I have granted all permissions in my .java.policy
5- I have all 4 files in my directory
6- I have run rmiregistry.exe and it run without any message

Yet I get below error.

I have the same problem with RMI example from the book "Java2 Enterprise Edition 1.4 Bible".

I really appereciate your help.

Regards,
Mac
ProgrammerNet.org






PhD Candidate: Distributed and Parallel Systems, Simulation and Modeling
Siamak Saarmann
Ranch Hand

Joined: Aug 21, 2004
Posts: 77
Hello again.

Sorry. I finally found the problem in SUN's RMI FAQ.

When I started the rmiregistry my codebase was not on my CLASSPATH (as I had created the directory and settings after running the rmiregistry).

By the way I am really really happy of finding this forum. Here seems to be Paradise of java programmers. (I hate SUN's forums as it is very slow and hard to navigate).

I really thank the owner's and people who have made here such a giant java community.

Regards,
Mac


Here is the FAQ:

6.2 If you encounter a problem running your RMI client
The second problem you could encounter is the receipt of a ClassNotFoundException when attempting to lookup a remote object in the registry. If you receive this exception in a stacktrace resulting from an attempt to run your RMI client code, then your problem is the CLASSPATH with which your RMI registry was started. See requirement C in section 6.0. Here is what the exception will look like:

java.rmi.UnmarshalException: Return value class not found; nested exception is:
java.lang.ClassNotFoundException: MyImpl_Stub
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:109
at java.rmi.Naming.lookup(Naming.java:60)
at RmiClient.main(MyClient.java:28)

Sam Don
Greenhorn

Joined: Aug 28, 2004
Posts: 3
Just wondering what IDE were you using ,, or is that done on UNIX , I am struggling getting my stub and skelton created using websphere.
Aster Pan
Greenhorn

Joined: Sep 09, 2004
Posts: 1
Well, I met the same problem too.

The message above has helped me with this.

If your OS is windows-based, when you run rmiregistry and your server, the enviornment variable CLASSPATH of both the two consoles must be set to refer your classpath.

I have forgot to set CLASSPATH to the console running rmiregistry before reading this message^^.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RMI Server problem, errors
 
Similar Threads
NX: Execute runme.jar with RMI
RMI in NetBeans 4.0
Exceptions in Rmi program
java.rmi exception - detailed error
Remote Exception Error.