File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.rmi.server.ExportException: Port already in use: 10344;

 
R Dom
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am implementing RMI. Here is the code


when i run the program it throws following exception always.. no matter what port i am using. I am using windows. I have tried with several different ports but none worked.
When I comment out the super() line in constructor.. the program runs successfully but then it doesnt make sense to comment out that code as client is going to use that port to access the UnicastRemoteObject.
I have checked no other services are running on port.

Exception-
java.rmi.server.ExportException: Port already in use: 10344; nested exception is
:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.<init>(Unknown Source)
at broker.LinkageBroker.<init>(LinkageBroker.java:17)
at broker.LinkageBroker.main(LinkageBroker.java:41)
Caused by: java.net.BindException: Address already in use: JVM_Bind

Anyone has idea whats going wrong here.?
Thanks
Ron
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using the same port twice.

First you use it in line 37 to start your Registry.
Then you use the same port in your LinkageBroker.

Is it reall the way is should be?

What happens if you use different ports on the Registry and the Broker?
 
R Dom
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

The client will communicate using port 10344. So for the registry lookup port has to be 10344 and to access the export object we would have to use same port again. Isnt that how it should work ?

Am I wrong here somewhere?
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. For registry use 1099 which is default
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic