users@glassfish.java.net

v2.1 node-agent as a windows service (sometimes) fails to start on reboot with an "Address already in use" exception

From: John Stalker <jrs.developer_at_gmail.com>
Date: Tue, 4 Aug 2009 15:07:31 -0400

Hi there,
  I've got several (ie 60) windows PCs that have been configured to start /
stop a node-agent (each with one glassfish instance) as a windows service.
  Trouble is, I am having intermittent failures on reboots. Most times, the
agent starts up just fine... but sometimes it doesn't and I have to go out
and manually stop the service (the windows service claims is starts
successfully even though the node-agent failed to start) and restart it.
That always fixes it. I have no trouble starting the service after I've
logged into the machine.
  Any ideas why I might be getting this error and how I might navigate
around this issue? Perhaps a way to statically assign the port that the
RMIStubRegistryHandler is attempting to use in the call to
startInsecureRegistry?
  I am running these agents on Windows XP Professional Version 2002 SP3,
Java 1.6.0_u14, Xeon X5560 with 3 GB of RAM.
  Thanks for any input!
John
PS For the most part, I've had great success setting up my DAS to administer
60 (and growing) node-agents on 60 workstations with 60 stand-alone
instances...this appears to be my biggest hangup.

Aug 4, 2009 1:45:08 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher
buildCommand
INFO:
C:\Program Files\Java\jdk1.6.0_14\jre/..\bin\javaw
-Dcom.sun.aas.instanceRoot=C:/glassfish/nodeagents/SL-XCJ-node-agent/agent
-Dcom.sun.aas.configRoot=C:/glassfish/config
-Dcom.sun.aas.defaultLogFile=C:/glassfish/nodeagents/SL-XCJ-node-agent/agent/logs/server.log
-Dcom.sun.aas.instanceName=SL-XCJ-node-agent
-Dcom.sun.aas.isNodeAgent=true
-Dcom.sun.aas.promptForIdentity=true
-Dcom.sun.appserv.admin.pluggable.features=com.sun.enterprise.ee.admin.pluggable.EEClientPluggableFeatureImpl
-Dcom.sun.appserv.nss.db=C:/glassfish/nodeagents/SL-XCJ-node-agent/agent/config
-Dcom.sun.appserv.pluggable.features=com.sun.enterprise.ee.server.pluggable.EEPluggableFeatureImpl
-Djava.endorsed.dirs=C:/glassfish/lib/endorsed
-Djava.library.path=C:\glassfish\lib;C:\glassfish\lib;C:\glassfish\bin;C:\glassfish\lib;C:\glassfish\lib
-Djava.security.auth.login.config=C:/glassfish/nodeagents/SL-XCJ-node-agent/agent/config/login.conf
-Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
-Djmx.invoke.getters=true
-XX:+UnlockDiagnosticVMOptions
-XX:LogFile=C:/glassfish/nodeagents/SL-XCJ-node-agent/agent/logs/jvm.log
-XX:+LogVMOutput
-cp
C:/glassfish/lib/comms-appserv-rt.jar;C:\glassfish\lib\appserv-launch.jar;C:/glassfish/lib\appserv-admin.jar;C:/glassfish/lib\appserv-ee.jar;C:/glassfish/lib\appserv-ext.jar;C:/glassfish/lib\appserv-rt.jar;C:/glassfish/lib\appserv-se.jar;C:/glassfish/lib\javaee.jar
com.sun.enterprise.ee.nodeagent.NodeAgentMain
start
 startInstancesOverride=NOTSET
syncInstances=false
monitorInterval=5
[#|2009-08-04T13:45:09.765-0400|INFO|sun-appserver2.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|NAGT0004:Starting
Node Agent...|#]

[#|2009-08-04T13:45:09.796-0400|CONFIG|sun-appserver2.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|DAS
url = service:jmx:rmi:///jndi/rmi://
node129.broad.mit.edu:8686/management/rmi-jmx-connector|#]

[#|2009-08-04T13:45:10.296-0400|INFO|sun-appserver2.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|NAGT0038:Executing
Synchronization for node-agent With DAS|#]

[#|2009-08-04T13:45:11.421-0400|WARNING|sun-appserver2.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|NAGT0003:An
exception has occurred during the initialization of the NodeAgent.
java.lang.RuntimeException: java.rmi.server.ExportException: Port already in
use: 1074; nested exception is:
    java.net.BindException: Address already in use: JVM_Bind
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.RmiStubRegistryHandler.startInsecureRegistry(RmiStubRegistryHandler.java:117)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.RmiStubRegistryHandler.<init>(RmiStubRegistryHandler.java:93)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.JmxConnectorServerDriver.prepare(JmxConnectorServerDriver.java:330)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.JmxConnectorServerDriver.startConnectorServer(JmxConnectorServerDriver.java:211)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.registerJmxConnector(NodeAgent.java:2785)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.configureAgent(NodeAgent.java:2941)
    at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.init(BaseNodeAgent.java:167)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:1395)
    at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:1153)
    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:270)
Caused by: java.rmi.server.ExportException: Port already in use: 1074;
nested exception is:
    java.net.BindException: Address already in use: JVM_Bind
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
    at
sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
    at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
    at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
    at
sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:190)
    at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
    at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:68)
    at
java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:222)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.RmiStubRegistryHandler.startInsecureRegistry(RmiStubRegistryHandler.java:111)
    ... 11 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at
com.sun.enterprise.admin.jmx.remote.server.rmi.JmxConnectorServerDriver$1.createServerSocket(JmxConnectorServerDriver.java:326)
    at
sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
    ... 19 more
|#]