• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

RMI Server problem, errors

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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




 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just wondering what IDE were you using ,, or is that done on UNIX , I am struggling getting my stub and skelton created using websphere.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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^^.
 
Tell me how it all turns out. Here is a tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic