users@glassfish.java.net

Glassfish V3 - Ant tasks

From: <glassfish_at_javadesktop.org>
Date: Mon, 23 Aug 2010 06:10:04 PDT

I'm trying to migrate my ant scripts from V2.1 to V3 and I'm having a problem with starting up the domain. Actually the domain starts fine but the problem is the ant task does not exit. It is obviously a problem because the rest of the script does not get executed until the server shuts down.

v2.1 command: <sun-appserv-admin explicitcommand="start-domain domain1"/>

despite what this documentation says http://docs.sun.com/app/docs/doc/820-7695/beaev?l=en&a=view the sun-appserv-admin does not support the explicitcommand attribute.

I've tried the following tasks, all of which block when the server starts up. This was not the case with the ant tasks in v2.1 and is a bit of a problem.

[code]
        <target name="start-server">
                <glassfish-start installdir="${asinstall.dir}" domain="domain1"/>
        </target>

        <target name="start-server2">
                <sun-appserv-admin command="start-domain domain1"/>
        </target>
        
        <target name="start-server3">
                <exec executable="cmd">
                        <arg value="/c" />
                        <arg value="asadmin start-domain domain1"/>
                </exec>
        </target>
        
        <target name="start-server4">
                    <java jar="${admin.cli.jar}" fork="true" spawn="false">
                            <arg line="start-domain domain1"/>
                    </java>
        </target>
[/code]

If I change the last task to spawn="true" then the task exits, but does so after one second so the server has not finished starting up yet.
[Message sent by forum member 'cain05']

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