This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The reason for your error is rooted in the fact that TCP/IP 'guarantees' delivery of data. As part of this, each connection between sokects on two computers (or one computer with the loopback) must be unique.
Think of it as though a computer is like a telephone exchange with a unique address (its IP address) and up to 65,535 telephone numbers (the total number of ports in a computer). When a server program starts on a computer (or more accurately an IP address), it reserves one of the ports for its exclusive use. This is like somebody reserving exclusive use of one of the telephone numbers in the telephone exchange. For SSH for instance, this is port is 22. The default port for RMI is 1099 if I remember. The combination of an IP address and a port number is known as a socket.
This 'reserving' of a port is known as binding. Once a port has been bound by a service, another program cannot bind itself to this same port. This makes sense as if, say, two ftp servers are trying to listen on the same port - which would answer a connection request from a client?
So what is a connection? It is a socket pair made up of the client IP address and port number along with the server IP address and port number. This must be unique for the reasons I have just explained.
The error message you have is because you are trying to bind a port number which has already been bound by another program. This will be because you have started the RMI server once, binding it to port 1099. You have then attempted to start another instance of the server on the same port. You will not be allowed to do this for the reasons above. You will need to stop the first instance of the server to release/unbind this port first.
Jon [ June 05, 2004: Message edited by: Jon Entwistle ]