users@glassfish.java.net

NodeAgent + multi-homed WinXP + JMX Connector URL confusion

From: John Stalker <jrs.developer_at_gmail.com>
Date: Thu, 30 Oct 2008 14:33:36 -0400

Hi there,
  I believe my problem is related to this:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=3289
but I can't seem to find the right answer. Hopefully someone can shine a
light on this for me...First, the situation:

I have a 2-nic Windows XP box (no choice in this sadly). My network is on
NIC 2 but the hostname of this machine (quite sadly) resolves to the IP
address of NIC 1. I realize there is a wonky bit of NIC binding order in XP
and that the first NIC found becomes the default; however, due to
assumptions in the code for another app running on this machine, I cannot
reorder the NIC binding without breaking this other app. (sorry for the
backstory).

First, I created a glassfish installation using the setup-cluster.xml file
and promptly deleted the domain that was created, since I am working with
node-agents.

Then, I created a node-agent using the following command where the IP
address is the one for NIC 2 and %computername% resolves to SL-XAV:

c:\glassfish\bin\asadmin.bat create-node-agent --interactive=false --host
DASHOST --port 4848 --user ADMINUSER --passwordfile
c:\glassfish\glassfish.txt --savemasterpassword=true --agentproperties
listenaddress=192.168.3.191:remoteclientaddress=192.168.3.191%computername%-node-agent

No problems so far. The initial rendezvous with the DAS happens and
appropriate properties files are created locally. Here is the contents of
the nodeagent.properties file:
#Node Agent Connection Properties
#Thu Oct 30 13:19:46 EDT 2008
agent.bind.status=BOUND
agent.adminPort=3130
agent.root=C\:\\glassfish\\nodeagents
agent.protocol=rmi_jrmp
agent.doNotConfirmServerCert=true
agent.client.host=192.168.3.191
agent.adminHost=192.168.3.191

However, when I try to start up the node-agent using:
c:\glassfish\bin\asadmin.bat start-node-agent --user ADMINUSER
--passwordfile c:\glassfish\glassfish.txt %computername%-node-agent

I get the following trouble in the server.log file:

[#|2008-10-30T11:53:06.312-0400|WARNING|sun-appserver9.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|NAGT0003:An
exception has occurred during the initialization of the NodeAgent.
java.io.IOException: Cannot bind to URL
[rmi://SL-XAV:2918/management/rmi-jmx-connector]:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: SL-XAV; nested
exception is:
    java.net.ConnectException: Connection refused: connect]
    at
javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804)
    at
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.JmxConnectorServerDriver.startConnectorServer(JmxConnectorServerDriver.java:218)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.registerJmxConnector(NodeAgent.java:1371)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.configureAgent(NodeAgent.java:1449)
    at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.init(BaseNodeAgent.java:167)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:695)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:574)
    at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.run(BaseNodeAgent.java:140)
    at
com.sun.enterprise.ee.nodeagent.NodeAgentMain.startup(NodeAgentMain.java:194)
    at
com.sun.enterprise.ee.nodeagent.NodeAgentMain.main(NodeAgentMain.java:265)
Caused by: javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: SL-XAV; nested
exception is:
    java.net.ConnectException: Connection refused: connect]
    at
com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:126)
    at
com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)
    at javax.naming.InitialContext.bind(InitialContext.java:400)
    at
javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)
    at
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)
    ... 9 more
Caused by: java.rmi.ConnectException: Connection refused to host: SL-XAV;
nested exception is:
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
    at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at
com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:120)
    ... 13 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:180)
    at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
    ... 18 more
|#]

Have I missed some configuration element somewhere because I have no idea
why it's using the hostname to try to connect instead of the
agent.adminHost.
Thanks so much for any help!
John