Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

object already exported exception with RMI

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gayatri Shende
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks .
It worked !

-Gayatri
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic