Hi All,
I'm trying to start the Sun App server using the ANT script. The same build.xml code snippet is as follow:
[code]
<target name="start-sun-server">
<taskdef name="sun-appserv-admin" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask">
<classpath path="${com.sun.aas.antLib}" />
</taskdef>
<echo message="Restarting appserver on ${admin.host}" />
<sun-appserv-admin explicitcommand="start-domain --user ${admin.user} ${domain.name}"
asinstalldir="${com.sun.aas.installRoot}">
<server instance="server" user="${admin.user}" passwordfile="${admin.password}"
host="localhost" port="${admin.port}" />
</sun-appserv-admin>
<echo message="Appserver started." />
</target>
[/code]
But whenever tried to execute the above target, I got the exception complaining the "the Server instance null doesn't exist.
Following is the command prompt o/p:
[code]
start-sun-server:
[echo] Restarting appserver on ps2858
[sun-appserv-admin] Executing: start-domain --user admin domain1
[sun-appserv-admin] Starting Domain domain1, please wait.
[sun-appserv-admin] Log redirected to D:\Sun\AppServer\domains\domain1\logs\server.log.
[sun-appserv-admin] com.sun.enterprise.config.ConfigException: Server Instance null does not exist.
[sun-appserv-admin] at com.sun.enterprise.config.serverbeans.ServerHelper.getServerByName(ServerHelper.java:114)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildInternalCommand(ASLauncher.java:759)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildCommand(ASLauncher.java:714)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.process(ASLauncher.java:418)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstanceAllJava(PEInstancesManager.java:283)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstance(PEInstancesManager.java:160)
[sun-appserv-admin] at com.sun.enterprise.admin.servermgmt.pe.PEDomainsManager.startDomain(PEDomainsManager.java:247)
[sun-appserv-admin] at com.sun.enterprise.cli.commands.StartDomainCommand.startDomain(StartDomainCommand.java:148)
[sun-appserv-admin] at com.sun.enterprise.cli.commands.StartDomainCommand.runCommand(StartDomainCommand.java:215)
[sun-appserv-admin] at com.sun.enterprise.cli.framework.CLIMain.invokeCommand(CLIMain.java:171)
[sun-appserv-admin] at com.sun.enterprise.cli.framework.CLIMain.invokeCLI(CLIMain.java:64)
[sun-appserv-admin] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[sun-appserv-admin] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[sun-appserv-admin] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[sun-appserv-admin] at java.lang.reflect.Method.invoke(Unknown Source)
[sun-appserv-admin] at org.apache.tools.ant.taskdefs.optional.sun.appserv.AppServerAdmin.execAdminCommand(AppServerAdmin.java:543)
[sun-appserv-admin] at org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask.execute(AdminTask.java:182)
[sun-appserv-admin] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[sun-appserv-admin] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[sun-appserv-admin] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[sun-appserv-admin] at java.lang.reflect.Method.invoke(Unknown Source)
[sun-appserv-admin] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[sun-appserv-admin] at org.apache.tools.ant.Task.perform(Task.java:348)
[sun-appserv-admin] at org.apache.tools.ant.Target.execute(Target.java:357)
[sun-appserv-admin] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[sun-appserv-admin] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[sun-appserv-admin] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[sun-appserv-admin] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[sun-appserv-admin] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[sun-appserv-admin] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[sun-appserv-admin] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[sun-appserv-admin] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[sun-appserv-admin] Timeout waiting for domain domain1 to go to starting state.
BUILD FAILED
D:\workspace\JSF\build.xml:80: An exception occurred while running the command.
The exception message is: CLI156 Could not start the domain domain1..
Total time: 3 minutes 2 seconds
[/code]
Please help me in this regard. Any pointer/hint will be greatly appreciated.
[Message sent by forum member 'sagarr']
http://forums.java.net/jive/thread.jspa?messageID=399591