2

At work we have two PCs with Windows XP and JDK 1.6.0_07 (no update of Java is possible for now), both with two network interfaces (NICs), the first has IPs in the form of 190.1.XXX.XXX (lets call it IA), and the second has 190.2.XXX.XXX (IB). "ipconfig /all" brings the host name HOSTNAME for both NICs, so do "nbtstat /a IA" and "nbtstat /a IB". No ping exists from IB to IA (I imagine, there isn't from IA to IB, although didn't check it). We should ensure that our real application works with JMX on both NICs for the sake of robustness. And here the problems start. The same behaviour may be observed with the following:

java -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar

On the second PC bring JConsole and attach to the remote process with one of: IA:9000 or IB:9000 or HOSTNAME:9000. They all work. But if I disable IA on the first PC (where Java2Demo is running), no attachment is possible at all (neither by IB, nor by HOSTNAME). Ping by IB works, so do mstsc (so there is a connection by IB). But if I disable IB, I get the attachment both by IA and by HOSTNAME.

  1. I just don't get how it is possible, that JConsole won't attach on IB in such a case. AFAIK, JMX uses 0.0.0.0 and listens on both NICs, if we don't define java.rmi.server.hostname. If this has something to do with the network itself, please give advice what to ask the IT department for.
  2. Our real application has a workaround: on first PC it starts 2 separate processes, each having JMX on one NIC only, and third process that merges data from the client with third JMX. The three processes are started from .bat file separately. I really would like to change this, having one process with one JMX on both NICs; or at least, start one process with two JMX, one for each NIC, if this is possible. Is it?

Thank you very much.

igorepst
  • 1,230
  • 1
  • 12
  • 20

1 Answers1

0

You can start multiple JMXConnectorServers on the same jvm using JMXConnectorServerFactory (there are many examples/tutorials online). you can expose the platform MBeanServer or your own custom MBeanServer.

jtahlborn
  • 52,909
  • 5
  • 76
  • 118
  • actually, as I see it, the connectivity problem is because of RMIRegistry that is bound to IA. According to [this](http://weblogs.java.net/blog/emcmanus/archive/2006/12/multihomed_comp.html), it is possible to get a workaround to this. According to [that](https://kr.forums.oracle.com/forums/thread.jspa?messageID=4816956), one have to run 2 JVMs. I should check the issue properly, but I'll be more than happy to get some help. Thanks – igorepst Jun 04 '12 at 19:01
  • using my suggestion, you would be setting up 2 separate rmi registries, so that would not be a problem. did you actually try this yet? – jtahlborn Jun 05 '12 at 00:57
  • Thank you for the response. Yes, I did. Unfortunately, it didn't work. Could you, please, post a link to any tutorial, that may be helpful in my case? As, again, according to the links that I posted, there are some that think it just impossible to do in one JVM. If you wish, I may post a reference application I wrote, that behaves the same way as our main app. Thank you! – igorepst Jun 09 '12 at 17:23