We're doing the same thing independently now! Update config-api, I
just checked-in.
On 7/23/2010 1:49 PM, Jennifer Chou wrote:
I ran ports and instance for these new changes. If it looks ok I'll
check it in. Attached are the source.
Running cluster now.
Index:
src/main/java/com/sun/enterprise/config/serverbeans/ServerHelper.java
===================================================================
---
src/main/java/com/sun/enterprise/config/serverbeans/ServerHelper.java
(revision
39006)
+++
src/main/java/com/sun/enterprise/config/serverbeans/ServerHelper.java
(working
copy)
@@ -52,9 +52,9 @@
*
* @author Byron Nevins
*/
-class ServerHelper {
+public class ServerHelper {
- ServerHelper(Server theServer, Config theConfig) {
+ public ServerHelper(Server theServer, Config theConfig) {
server = theServer;
config = theConfig;
@@ -84,13 +84,17 @@
}
String getHost() {
- String hostName = null;
Dom serverDom = Dom.unwrap(server);
Nodes nodes = serverDom.getHabitat().getComponent(Nodes.class);
if (server == null || nodes == null) {
return null;
}
+ return getHost(nodes);
+ }
+
+ public String getHost(Nodes nodes) {
+ String hostName = null;
// Get it from the node associated with the server
String nodeName = server.getNode();
if (StringUtils.ok(nodeName)) {
Index: src/main/java/com/sun/enterprise/config/util/PortManager.java
===================================================================
--- src/main/java/com/sun/enterprise/config/util/PortManager.java
(revision 39006)
+++ src/main/java/com/sun/enterprise/config/util/PortManager.java
(working copy)
@@ -39,6 +39,7 @@
import com.sun.enterprise.config.serverbeans.Config;
import com.sun.enterprise.config.serverbeans.Domain;
import com.sun.enterprise.config.serverbeans.Server;
+import com.sun.enterprise.config.serverbeans.ServerHelper;
import com.sun.enterprise.config.serverbeans.SystemProperty;
import com.sun.enterprise.util.ObjectAnalyzer;
import com.sun.enterprise.util.StringUtils;
@@ -62,8 +63,9 @@
newServer = theNewServer;
domain = theDomain;
+ ServerHelper helper = new ServerHelper(newServer, config);
serverName = newServer.getName();
- host = newServer.getHost();
+ host = helper.getHost(domain.getNodes());
allPorts = new ArrayList<Integer>();
newServerPorts = new ServerPorts(cluster, config, domain,
newServer);
On 7/23/2010 7:45 PM, Byron Nevins wrote:
Can you try it on devtests and see if it works?
On 7/23/2010 11:42 AM, Jennifer Chou wrote:
ok sounds good. not checking anything in.
On 7/23/2010 7:32 PM, Byron Nevins wrote:
I recommend NOT doing this. We should have this ugly code in one and
only one place. ServerHelper has those lines now. It just needs to be
refactored into another method in ServerHelper where you call it with a
Nodes or Node object...
On 7/23/2010 10:44 AM, Jennifer Chou wrote:
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
--
Byron Nevins - Oracle Corporation
Home: 650-359-1290
Cell: 650-784-4123
Sierra: 209-295-2188
---------------------------------------------------------------------
To unsubscribe, e-mail: admin-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: admin-help@glassfish.dev.java.net
--
Byron Nevins - Oracle Corporation
Home: 650-359-1290
Cell: 650-784-4123
Sierra: 209-295-2188
---------------------------------------------------------------------
To unsubscribe, e-mail: admin-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: admin-help@glassfish.dev.java.net
---------------------------------------------------------------------
To unsubscribe, e-mail: admin-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: admin-help@glassfish.dev.java.net
--
Byron Nevins - Oracle Corporation
Home: 650-359-1290
Cell: 650-784-4123
Sierra: 209-295-2188