admin@glassfish.java.net

Re: create-local-instance fails in deployment devtests; admin hudson jobs are failing

From: Jennifer Chou <jennifer.chou_at_oracle.com>
Date: Fri, 23 Jul 2010 18:44:15 +0100

Here's the patch I was going to checkin. just running ql on it right
now. Let me know if you want me to go ahead with checking in.
I was thinking that since server being created as passed to
PortManager. Then port manager calls the getHost duck typed method on
Server which I think may not have that info yet?
So I removed call to duck typed method server.getHost in PortManager.

Index: src/main/java/com/sun/enterprise/config/util/PortManager.java
===================================================================
--- src/main/java/com/sun/enterprise/config/util/PortManager.java
(revisio
n 39006)
+++ src/main/java/com/sun/enterprise/config/util/PortManager.java
(working
 copy)
@@ -38,6 +38,7 @@
 import com.sun.enterprise.config.serverbeans.Cluster;
 import com.sun.enterprise.config.serverbeans.Config;
 import com.sun.enterprise.config.serverbeans.Domain;
+import com.sun.enterprise.config.serverbeans.Node;
 import com.sun.enterprise.config.serverbeans.Server;
 import com.sun.enterprise.config.serverbeans.SystemProperty;
 import com.sun.enterprise.util.ObjectAnalyzer;
@@ -63,12 +64,26 @@
             newServer = theNewServer;
             domain = theDomain;
             serverName = newServer.getName();
- host = newServer.getHost();
+ String nodeName = newServer.getNode();
+ if (!StringUtils.ok(nodeName))
+ throw new
TransactionFailure(Strings.get("PortManager.noNodeSpecified", serverName));
+
+ Node node = domain.getNodeNamed(nodeName);
+ if (node == null)
+ throw new
TransactionFailure(Strings.get("PortManager.noNode",nodeName));
+
+ host = node.getNodeHost();
+ // XXX Hack to get around the fact that the default localhost
+ // node entry is malformed
+ if (host == null && nodeName.equals("localhost")) {
+ host = "localhost";
+ }
+
             allPorts = new ArrayList<Integer>();
             newServerPorts = new ServerPorts(cluster, config, domain,
newServer);

             if (!StringUtils.ok(host))
- throw new
TransactionFailure(Strings.get("PortManager.noHost",serverName));
+ throw new
TransactionFailure(Strings.get("PortManager.noHost",nodeName));

             isLocal = NetUtils.IsThisHostLocal(host);

@@ -249,7 +264,7 @@
     private final Server newServer;
     private final boolean isLocal;
     private final Domain domain;
- private final String host;
+ private String host = null;
     private final List<Integer> allPorts;
     private final List<Server> allServers;
     private final List<ServerPorts> serversOnHost;

Index: src/main/java/com/sun/enterprise/config/util/LocalStrings.properties
===================================================================
--- src/main/java/com/sun/enterprise/config/util/LocalStrings.properties
(revision 39006)
+++ src/main/java/com/sun/enterprise/config/util/LocalStrings.properties
(working copy)
@@ -3,7 +3,9 @@
 PortUtils.duplicate_port=Found two system-property elements with the
same port
number ({0}) for {1}.
 PortUtils.non_int_port=Found a system-property with a non-integer port
number (
{0}) for {1}.
 PortUtils.illegal_port_number=The supplied port number, {0}, for the
server, {1
}, is illegal. Legal values are 0 to {2} inclusive.
-PortManager.noHost=There is no node-agent-ref specified for the
instance {0}.
+PortManager.noNodeSpecified=There is no node specified for the instance
{0}.
+PortManager.noNode=Node {0} does not exist.
+PortManager.noHost=Node host is not specified on node {0}.
 PortManager.noFreePort=Can''t locate a free port. None of the ports
between {0
} and {1} are available.

On 7/23/2010 6:35 PM, Byron Nevins wrote:
> I just changed things last night -- I'll take a look.
>
> Jennifer -- Server.getHostName() on DAS returns null!!! I'll fix it...
>
> On 7/23/2010 9:49 AM, Jennifer Chou wrote:
>> working on fix right now.
>>
>> On 7/23/2010 5:39 PM, Tom Mueller wrote:
>>> Yes.
>>> Tom
>>>
>>> On 7/23/2010 11:37 AM, Tim Quinn wrote:
>>>> Hi.
>>>>
>>>> The Hudson admin job is red with (among other things) this error
>>>> when trying to create an instance:
>>>>
>>>> [java] remote failure: Exception while adding the new configuration org.jvnet.hk2.config.TransactionFailure: There is no node-agent-ref specified for the instance in_892228. : org.jvnet.hk2.config.TransactionFailure: There is no node-agent-ref specified for the instance in_892228.
>>>>
>>>>
>>>> We are seeing the same error in the deployment devtests in trying
>>>> to create an instance.
>>>> Is someone looking into this?
>>>> - Tim
>>
>