Issue Details (XML | Word | Printable)

Key: GLASSFISH-9654
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Bhavanishankar
Reporter: asigl
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

instance name must be set as system property

Created: 22/Sep/09 01:24 PM   Updated: 06/Jan/11 06:32 PM
Component/s: command_line_interface
Affects Version/s: 9.1.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 9,654
Status Whiteboard:

V2.1.1_exclude

Tags:
Participants: asigl, Bhavanishankar, Bill Shannon, jagadesh and Tom Mueller


 Description  « Hide

I tried to start glassfish with ant for integration tests. I used the following
commands in my ant script:

<path id="glassfish.ant.classpath">
<fileset dir="${glassfish.home.dir}">
<include name="lib\sun-appserv-ant.jar"/>
<include name="javadb\lib\derby.jar"/>
<include name="jbi\lib\jbi-ant-tasks.jar"/>
</fileset>
</path>

<taskdef resource="com/sun/tools/appserver/antlib.xml"
uri="antlib:com.sun.tools.appserver" classpathref="glassfish.ant.classpath"/>

<gf:sun-appserv-admin explicitcommand="start-domain"
asinstalldir="${glassfish.home.dir}"/>

After execution the following error occurs:

[gf:sun-appserv-admin] Executing: start-domain
[gf:sun-appserv-admin] Starting Domain domain1, please wait.
[gf:sun-appserv-admin] Default Log location is
D:\Development\server\glassfish-2.1\domains\domain1\logs\server.log.
[gf:sun-appserv-admin] com.sun.enterprise.config.ConfigException: Server
Instance null does not exist.
[gf:sun-appserv-admin] at
com.sun.enterprise.config.serverbeans.ServerHelper.getServerByName(ServerHelper.java:114)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildInternalCommand(ASLauncher.java:771)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildCommand(ASLauncher.java:726)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.launch.ASLauncher.process(ASLauncher.java:430)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstanceAllJava(PEInstancesManager.java:287)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstance(PEInstancesManager.java:162)
[gf:sun-appserv-admin] at
com.sun.enterprise.admin.servermgmt.pe.PEDomainsManager.startDomain(PEDomainsManager.java:243)
[gf:sun-appserv-admin] at
com.sun.enterprise.cli.commands.StartDomainCommand.startDomain(StartDomainCommand.java:148)
[gf:sun-appserv-admin] at
com.sun.enterprise.cli.commands.StartDomainCommand.runCommand(StartDomainCommand.java:215)
[gf:sun-appserv-admin] at
com.sun.enterprise.cli.framework.CLIMain.invokeCommand(CLIMain.java:171)
[gf:sun-appserv-admin] at
com.sun.enterprise.cli.framework.CLIMain.invokeCLI(CLIMain.java:64)
[gf:sun-appserv-admin] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[gf:sun-appserv-admin] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[gf:sun-appserv-admin] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[gf:sun-appserv-admin] at java.lang.reflect.Method.invoke(Unknown Source)
[gf:sun-appserv-admin] at
org.apache.tools.ant.taskdefs.optional.sun.appserv.AppServerAdmin.execAdminCommand(AppServerAdmin.java:543)
[gf:sun-appserv-admin] at
org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask.execute(AdminTask.java:182)
..........
[gf:sun-appserv-admin] Timeout waiting for domain domain1 to go to starting state.

BUILD FAILED

I investigated this bug a bit further and found a workaround.

In the method ASLauncher.buildInternalCommand (line 770) the "serverName" is
fetched from the java system property "com.sun.aas.instanceName".
If I set this property as JVM argument for Ant it works. In the case of asadmin
shell script it works because there this property is set as JVM argument.

In the code I found a code snippet where this is set
(com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstanceUsingScript
line 356):

//FIXTHIS: The com.sun.aas.instanceName probably needs to be dynamically set,
but for
//now this is not important as it is not being used.
args.add("-Dcom.sun.aas.instanceName=server");

This code will only be executed if the OS environment variable "OLD_LAUNCHER" is
set to "true" (see PEInstancesManager.startInstance line 142).
If it is not set the method "PEInstancesManager.startInstanceAllJava" will be
executed as you see in the stack trace above.



Bill Shannon added a comment - 06/Jan/11 06:32 PM

Please verify whether this still occurs with 3.1.


Tom Mueller added a comment - 06/Jan/11 01:57 PM

Assigning to owner of subcategory.


jagadesh added a comment - 15/Oct/09 04:36 PM

Will not be fixed for V2.1.1


jagadesh added a comment - 15/Oct/09 04:36 PM

Will not be fixed for V2.1.1


Bill Shannon added a comment - 23/Sep/09 03:05 PM

Assigning to Siraj to see if this issue still occurs in v3.