ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pardey, Craig" <CRAIG.PAR...@tdsecurities.com>
Subject RE: Exec JBoss - window not closed on exit
Date Wed, 16 Jun 2004 14:38:28 GMT

I tried using the <exec> given below, but it creates a blocking command.  i.e. Ant waits
for the run.bat to exit before continuing.  This is no good for me because I want to start
JBoss, run my acceptance tests, then shut it down.

As such I need to spawn JBoss.  The problem is not that JBoss is waiting for a keystroke.
 JBoss shuts down fine, the script exits, but the window returns to the command prompt instead
of closing.

<exec executable="cmd.exe" dir="${jboss.home}/bin" spawn="true">
  <arg line="/c start ${script}"/>
  <env key="NOPAUSE" value="true"/>
</exec>

<exec executable="cmd.exe" dir="${jboss.home}/bin" spawn="false">
  <arg line="/c shutdown.bat -u user -p pwd"/>
  <env key="NOPAUSE" value="true"/>
</exec>

Craig

-----Original Message-----
From: Donald Strong [mailto:dstrong@agentissoftware.com]
Sent: Tuesday, June 15, 2004 7:54 PM
To: Ant Users List
Subject: RE: Exec JBoss - window not closed on exit


Hi Craig,

Kieth has the correct solution, but you apply it to the startup
command AS WELL.
The DOS window stays open because it is waiting for a keystroke.
Setting NOPAUSE fixes that on both startup and shutdown.

Regards
Donald.

This is straight out of our jboss.xml file.

        <!--
        Start the desired appserver.  The start opertaion requires that the
        server.domain.dir property be set to the directory of the instance
        that is to be started.  The server.host and server.port properties
        are also used, but for informational purposes only.
     -->
    <target name="start" depends="-init"
     description="Start the App Server">
        <echo>Start appserver http://${server.host}:${webserver.port}</echo>
        <echo>APPSERVER STARTING</echo>
        <exec executable="${server.bin.dir}\run.bat"
                     dir="${server.bin.dir}"
                      os="Windows XP Windows 2000"
          resultproperty="server.exit-status"
             failonerror="false" >
           <env key="NOPAUSE" value="true"/>
        </exec>
        <echo>APPSERVER STOPPED WITH RESULT CODE:
${server.exit-status}</echo>
    </target>

     <!--
        Stop the desired application server.
     -->
    <target name="stop" depends="-init"
     description="Stop the App Server">
        <property name="shutdown.bat"
              location="${server.bin.dir}/shutdown.bat"/>
        <echo>Stop appserver http://${server.host}:${webserver.port}</echo>
        <echo>${shutdown.bat}"</echo>
        <exec executable="${server.bin.dir}\shutdown.bat"
                     dir="${server.bin.dir}"
                      os="Windows XP Windows 2000"
          resultproperty="server.exit-status"
             failonerror="false" >
           <env key="NOPAUSE" value="true"/>
        </exec>
    </target>

> -----Original Message-----
> From: Pardey, Craig [mailto:CRAIG.PARDEY@tdsecurities.com]
> Sent: Wednesday, 16 June 2004 2:53 AM
> To: Ant Users List
> Subject: RE: Exec JBoss - window not closed on exit
>
>
>
> Shutting down JBoss is not the problem.  The problem is that when
> JBoss does shut down it leaves the command window open.
>
> This becomes a problem in a continuous build situation because
> over a short period of time the build server ends up with loads
> of idle command windows open.
>
> -----Original Message-----
> From: Keith Hatton [mailto:khatton@axiomsystems.com]
> Sent: Tuesday, June 15, 2004 12:15 PM
> To: Ant Users List
> Subject: RE: Exec JBoss - window not closed on exit
>
>
> I use this fragment to stop JBoss:
>
> <exec dir="${jboss.home}/bin" executable="cmd.exe" os="Windows 2000">
>     <arg line="/c shutdown.bat -S"/>
>     <env key="NOPAUSE" value="true"/>
> </exec>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message