aspose file tools*
The moose likes Beginning Java and the fly likes java.rmi.server.ExportException: Port already in use: 10344; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.rmi.server.ExportException: Port already in use: 10344;" Watch "java.rmi.server.ExportException: Port already in use: 10344;" New topic
Author

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

R Dom
Greenhorn

Joined: Sep 08, 2010
Posts: 19
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


Cheers,
RD
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

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

Joined: Sep 08, 2010
Posts: 19
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
Bartender

Joined: May 31, 2011
Posts: 1776
Yes. For registry use 1099 which is default
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.rmi.server.ExportException: Port already in use: 10344;
 
Similar Threads
question about rmi registry
problems in programatically starting RMI Registry
question about rmi registry
question about rmi registry
Exception in RMI program