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

I'm writing an RMI application.
When running the RMIRegistry I get the following exception:

java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
   java.net.BindException: Address in use: JVM_Bind
java.net.BindException: Address in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:405)
at java.net.ServerSocket.<init>(ServerSocket.java:170)
at java.net.ServerSocket.<init>(ServerSocket.java:82)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:30)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:312)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:559)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:222)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:176)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:319)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:119)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:125)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:95)
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:81)
at sun.rmi.registry.RegistryImpl.main(RegistryImpl.java:320)

What could be the cause and how I can solve this?
LVL 2
s_lavieAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Venci75Connect With a Mentor Commented:
There is an application that already uses the RMI registry default port (1099). If this is not another instance if the registry you can try to start your RMI registry on a different port:
rmiregistry 1111
where 1111 is the new port.
0
 
Venci75Commented:
probably you are trying to run a second instance of the RMI registry
0
 
s_lavieAuthor Commented:
I'm afraid this is not the reason...
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
s_lavieAuthor Commented:
It does run on another port, but how I can find which application uses port 1099.
My OS is win2000 - and I have no clue which application uses that port.
0
 
Venci75Commented:
I don't know how you can do this. But you can try to check whether it is not done by a service.
0
 
Venci75Commented:
... or may be another instance of the registry is started as a service
0
 
rashidkamranbsCommented:
Of course another process using the 1099 port.. in windows 200 ya can execute a command like

c:\netstat -a

it will list all the process with listening ports..

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.