Running RMI Server on Different Port - binding issues



Hey all,
I've got a RMI client and server application with both the cliet and
server running on localhost. Getting everything running at the same
time hasn't been a problem unless I try to specify a different port
other than 1099 (default port). Here are the steps I take to try and
get the server up and running: (trying this on a winxp home edition
box)

from command prompt I run: rmiregistry 1005

I then execute my rmi server from eclipse, and I get the following
exception:
java.rmi.server.ExportException: Port already in use: 1005; 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 com.networkprogramming.rmi.Quote.<init>(Quote.java:35)
at com.networkprogramming.rmi.QuoteServer.main(QuoteServer.java:25)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(Unknown
Source)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unknown
Source)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source)

The line of code that the exception is originating from is:
UnicastRemoteObject.exportObject(this, portNumber);
where port number is also 1005.

Note that if I simply run rmiregistry followed by
UnicastRemoteObject.exportObject(this);
i.e. I don't specify a port, everything goes off without a hitch.
I've tried a few different configurations but nothing seems to get me
beyond this point... Any insite would be appreciated.
Thanks,
Andy

.



Relevant Pages

  • RE: Some technical errors
    ... If the SMTP server is not running on port 25 TCP it is not a public ... Manager - Computer Assurance Services BDO Chartered Accountants & ...
    (Security-Basics)
  • Re: SRV RRs support in Internet Explorer?
    ... The port number could be implicit (i.e. ... At any point in time, a server could fail ... can't effectively LB or backup because NSs cache the records for the TTL ... I still don't see how SRV records would help backup or LB. ...
    (microsoft.public.win2000.dns)
  • Re: Still cant connect to RWW or OWA remotely
    ... I get 'cannot find server or dns error' on both ... TCP [port number]> to open the ports. ... As for error messages when I fail to access RWW with the laptop, ... network, no connection seems possible. ...
    (microsoft.public.windows.server.sbs)
  • Re: cannot send mail from Windows mail
    ... When a username/password combination doesn't work in Windows Mail, ... I mean I dont use it but as outgoing address for my ISP account. ... youir username and password are correct for your mail server". ... Ask your home ISP if they support SMTP on a port other than 25. ...
    (microsoft.public.windows.vista.mail)
  • Re: How to trigger server to reattempt printer connection
    ... The spooler does not log any SNMP data. ... Best practices and known issues when you install Windows Server 2003 Service ... Before restarting the spooler next time, create a new port name to the ... This does not happen often, but when it does, it seems to stay offline ...
    (microsoft.public.windows.server.general)