• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem running RMI on Netbeans 5.0

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using net 5.0 which uses java 1.5.0_06 version.
Here is what i did
New project
This project has an interface that extends that Remote interface and all the methods in this interface are de
clard to throw a RemoteException.

I have the service class that implements this inteface and its no-arg constructor throws a RemoteException.

And i have a Main class that continst the main method which puts the service class in the rmi registry
Naming.bind(name,object)

When i run the main class i receive the following exception :
emoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: tryrmi.SayHello

I know that java 1.5 autogenerates the stub and skeleton objects.
Anybody can tell me how to solve this problem??
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably have not exported the object. RMI Objects need to be exported to recieve remote invocations. Two ways I know you can do that:
1. extend java.rmi.server.UnicastRemoteObject - here, the constructor exports the object - the easier method.
2. from somewhere in your code (say your server that makes this remote object available) export the object using static method UnicastRemoteObject.exportObject(theRemoteObject)

guess this should solve the problem. You should read more on RMI if this solves the problem.... you probably need some more understanding of how and why RMI works.

happy coding.
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tryed both of the two methods you mentione but none of them worked.
I have read about RMI and i am sure i am doing all the classes the right way??
I dont know what's the bug??
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that the RMI is not supported in NetBeans 5.0
[ October 12, 2006: Message edited by: Khaled Mahmoud ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic