Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo RMIRegistry.exe on the same port?
    text
    copied!<p>I'm working on a Windows 7 (Professional, 64bit) system and I've seen the current situation, can someone highlight me and explain how's possible? I have installed both Java 6 (JRE only) and Java 7 (JDK), both 64 bits.</p> <ol> <li><p>From command prompt I run <code>rmiregistry.exe</code> (default port 1099) from <code>jre6/bin</code> directory. While that one is running, from another command prompt I try to run it again. It gives me back an exception saying that the port is already bound.</p></li> <li><p>Same, with <code>rmiregistry.exe</code> from <code>jdk7/bin</code> directory. Same exception, already bound.</p></li> <li><p>From command prompt I run <code>rmiregistry.exe</code> (default port 1099) from <code>jre6/bin</code> directory. While that one is running, from another command prompt I try to run the <code>rmiregistry.exe</code> (default port 1099) from the <code>jdk7/bin</code> directory. It runs! And looking and <code>netstat -a -b -o</code> results, both PIDs are listening to port 1009 on IPv4 and IPv6. The first one to be ran, replies to RMI operations and APIs.</p></li> </ol> <p>How's that possible? How can two RMIRegistry can be listening on port 1099? Am I missing something?</p> <p>Thanks for any help.</p> <hr> <p>More details on this:</p> <ul> <li>running the Java 6 RMI registries, the exception stacktrace goes back to <code>Caused by: java.net.BindException: Address already in use: JVM_Bind</code> from the <code>java.net.PlainSocketImpl.socketBind(Native Method)</code>;</li> <li>running the Java 7 RMI registries, the exception stacktrace, instead, comes from the <code>java.net.DualStackPlainSocketImpl.bind0(Native Method)</code>.</li> </ul> <p>Is there a meaning? Has this something to do with the <code>-Djava.net.preferIPv4Stack=true</code> VM option? How can I, from Java 7, know if both IPv4 and IPv6 RMI ports have been occupied by any of Java 6 or Java 7 RMI Registry?</p> <hr> <p>Again, more details...</p> <ul> <li><p>I've stopped everything. Just "for fun" I've ran Calibre (the e-books management application) internal web server on port 1099;</p></li> <li><p><code>rmiregistry.exe</code> from Java 6 and it tells me it cannot run because the port is busy;</p></li> <li><p><code>rmiregistry.exe</code> from Java 7 runs... but, as before, the replies on port 1099 come from Calibre.</p></li> </ul> <hr> <p>One more: running the same couple of RMI Registries (Java 6 + Java 7, 32 bit) on Ubuntu (with OpenJDK), I have the "Port already in use message" through the <code>java.net.PlainSocketImpl.socketBind(Native Method)</code> (even for Java 7!). No two things can occupy the same port... as usual! So, at least, I know it's a Windows 7 + Java issue!</p> <p>Any other hint for me?</p> <hr> <p>I saw something similar using DatagramSocket: I'm using it on a port with Java 6, then I run another same application with Java 7 and it connects to that port (but does not work) even if it is already taken. Then, launching a third identical application, with Java 7, this one becomes aware that such port is already busy. I think this could be the same with RMI Registry.</p> <p>Why I can run two RMI Registries on the same port? Why Java 6 and Java 7 have, in some ways, "conflicting" behaviours with respect to sockets and ports? Also, why Windows (7, in my situation) does not block a second request on the same port?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload