File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem running RMI on Netbeans 5.0

 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • 0
  • Mark post as helpful
  • send pies
  • 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??
 
Bod Toki
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic