Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problems in programatically starting RMI Registry  RSS feed

 
Ashok Pradhan
Ranch Hand
Posts: 180
Eclipse IDE Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to start registry programmatically:-
I have written the Server class, but it gives me RuntimeException:


Exception:


Strting Weather Service.....
Weather server Exception
java.rmi.server.ExportException: object already exported
at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:172)
at sun.rmi.transport.Transport.exportObject(Transport.java:74)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:229
)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:19
0)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.
java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.
java:235)
at WeatherServiceImpl.main(WeatherServiceImpl.java:26)
Press any key to continue . . .


please help...
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have only given the main method code. Can you give the entire WeatherServiceImpl code?
The issue does not seem to be with the RMI registry but with the export operation.
If your server extends UnicastRemoteObject, then it is automatically exported in the constructor, you do not need to export explicitly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!