File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes  object already exported exception with RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark " object already exported exception with RMI" Watch " object already exported exception with RMI" New topic
Author

object already exported exception with RMI

Gayatri Shende
Greenhorn

Joined: Dec 26, 2007
Posts: 11
Hi

I am trying to bind my RMI server to registry. I always get this exception saying object already exported.
I tried changing the port number of rmi registry. But didnt help.
Any HInts? Please help asap.

here is my code:

RMIClientSocketFactory rmiClientSocketFactory = new SslRMIClientSocketFactory();

RMIServerSocketFactory rmiServerSockeyFactory = new SslRMIServerSocketFactory();

IServer stub = (IServer) UnicastRemoteObject.exportObject(this, 0,

rmiClientSocketFactory, rmiServerSockeyFactory);

Registry registry = LocateRegistry.createRegistry(5255);

registry.rebind("MyServer", stub);



-Thanks
Gayatri
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Hi Gayatri,
Please UseCodeTags while posting code.
Does your server implementation extends UnicastRemoteObject? If yes, then you do not need to explicitly export it using UnicastRemoteObject.exportObject() methods. As soon as you initialize a class that extends UnicastRemoteObject, the object is exported by RMI.
If you try to export a class instance that extends UnicastRemoteObject, you will always get the exception that you have mentioned.


apigee, a better way to API!
Gayatri Shende
Greenhorn

Joined: Dec 26, 2007
Posts: 11
Thanks .
It worked !

-Gayatri
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: object already exported exception with RMI
 
Similar Threads
UnicastRemoteObject exportObject()
problems in programatically starting RMI Registry
Not implementing the RemoteException
Concerns about exporting objects - unable to unexport
RMI SSL Server failing silently on startup after 60s