ExportException: Port already in use: 1099; nested exception
843793Jan 4 2007 — edited Jan 6 2007hi,
Im running a RMI program but every now and then i get the following error. Is there a way to stop this from happening because i kill of all the process in the IDE yet it still comes up with the error. So at the moment i have to restart my PC.
java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
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:190)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
public class ChatServer
{
public ChatServer()
{
try
{
Chat c = new ChatImp();
LocateRegistry.createRegistry(1099);
Naming.rebind("rmi://localhost:1099/chat", c);
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void main(String args[])
{
new ChatServer();
}
}
Message was edited by:
tbr_84