webtier@glassfish.java.net

issue of the destruction of definition of <server-ref> in domian.xml

From: <webtier_at_javadesktop.org>
Date: Thu, 19 Jun 2008 23:49:07 PDT

Hello Kedar :
Hello Dev Teams:

  I have a problem about the destruction of definition of <server-ref> in domian.xml.

  -> kedar,Dev Members:

    I have ever meeted an case in which when creating instance, <server-ref> tag in domian.xml missed "ref" attribute. Then, I found the following information in the server.log:

--------------------------------------------------------------------------------------------------------------------
..........
Caused by: com.sun.enterprise.admin.servermgmt.InstanceException:
java.lang.NullPointerException
        at
com.sun.enterprise.ee.admin.clientreg.InstanceRegistry.getInstanceConnectionInfo(InstanceRegistry.java:194)
        at
com.sun.enterprise.ee.admin.configbeans.PortConflictCheckerConfigBean.checkForPortConflicts(PortConflictCheckerConfigBean.java:447)
        at
com.sun.enterprise.ee.admin.configbeans.ServersConfigBean.resolvePortConflicts(ServersConfigBean.java:745)
        at
com.sun.enterprise.ee.admin.configbeans.ServersConfigBean.createServerInstance(ServersConfigBean.java:874)
        at
com.sun.enterprise.ee.admin.mbeans.ServersConfigMBean.createServerInstance(ServersConfigMBean.java:238)
        at
...
Caused by: com.sun.enterprise.ee.admin.servermgmt.AgentException:
java.lang.NullPointerException
        at
com.sun.enterprise.ee.admin.clientreg.InstanceRegistry.findConnectionInfo(InstanceRegistry.java:108)
        at
com.sun.enterprise.ee.admin.clientreg.InstanceRegistry.getInstanceConnectionInfo(InstanceRegistry.java:192)
        ... 76 more
Caused by: java.lang.NullPointerException
        at
com.sun.enterprise.config.serverbeans.ServerHelper.isServerClustered(ServerHelper.java:410)
        at
com.sun.enterprise.config.serverbeans.PropertyResolver.<init>(PropertyResolver.java:60)
        at
com.sun.enterprise.config.serverbeans.ServerHelper.getJMXConnectorInfo(ServerHelper.java:331)
        at
com.sun.enterprise.ee.admin.clientreg.InstanceRegistry.findConnectionInfo(InstanceRegistry.java:104)
        ... 77 more
--------------------------------------------------------------------------------------------------------------------

I am very curious about the above exception,especially the "NullPointerException".

I start to look for the clue in the code.And I have some issues:

In ServersConfigBean.java, createClusteredServerInstance(..) method has some contents:
.....
   //Add the server to the cluster
        ServerRef serverRef = new ServerRef();
        serverRef.setRef(server.getName());
        cluster.addServerRef(serverRef, OVERWRITE);
.....
Can "cluster.addServerRef(serverRef, OVERWRITE) " add the <server-ref> to the domain.xml only if the "OVERWRITE" is the TRUE?
If not, Can "cluster.addServerRef(serverRef, OVERWRITE) " add the <server-ref> to the current ConfigContext?

I still find the "flushAll()" method should perisist the config changes to the domain.xml.isn't it?

Could you please give me some suggestion?
Thanks!

Mike.Tang
[Message sent by forum member 'codeprince' (codeprince)]

http://forums.java.net/jive/thread.jspa?messageID=281523