Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:43:06+00:00 2026-06-15T15:43:06+00:00

I have an Ant script which is used to deploy my application on two

  • 0

I have an Ant script which is used to deploy my application on two different machines at a time. With the local machine i do not have a problem, but when it comes to the remote machine, I want to check if Jboss is up or not. If it is up then I want to shut it down but if it is not then nothing should be done. I tried to do this by keeping the attribute of <sshexec> as failonerror="on". This works well when the Jboss is already down and the shutdown command only gives some errors. But the real problem that i faced was when Jboss was running and when the shutdown command was executed, it did not shutdown properly and gave some error. It is in these situations that I want to stop my build script and let the user know that there is something wrong with Jboss on the other machine and it needs to be looked at.

The target code for stopping the remote Jboss is

<target name="stopRemoteJboss" description="Stops Remote Instance of Jboss">
        <echo message="Stopping Remote Jboss" />
        <sshexec trust="true" host="${jboss.remote.host}" username="${jboss.remote.username}" password="${jboss.remote.password}" command="${jboss.remote.home}/bin/shutdown.sh -S" port="${jboss.remote.port}"/>
    </target>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:43:07+00:00Added an answer on June 15, 2026 at 3:43 pm

    After a short check, I’ve found following, maybe you could reuse/or use as an inspiration for your script: http://shrubbery.homeip.net/c/display/W/Starting+JBoss+with+ANT

    The relevant part for you seem to be:

    <java jvm="@{jdkHome}/bin/java"
          classname="org.jboss.Shutdown" fork="true" failonerror="false" resultproperty="shutdown.rc">
        <arg line="-s jnp://@{bindAddr}:@{jnpPort}"/>
        <classpath>
            <pathelement path="@{jbossInstallDir}/bin/shutdown.jar"/>
            <pathelement path="@{jbossInstallDir}/client/jbossall-client.jar"/>
        </classpath>
    </java>
    <echo>Shutdown rc = ${shutdown.rc}</echo>
    <condition property="shutdown.okay">
        <equals arg1="${shutdown.rc}" arg2="0"/>
    </condition>
    <fail unless="shutdown.okay" message="Unable to shut down JBoss (maybe it hasn't fully started yet?)."/>
    <echo>Waiting for @{bindAddr}:@{jnpPort} to stop listening...</echo>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ant script which runs tests then deploys my application to a
I have an Ant script which turns my Java application into a nice Mac
Let's suppose I have a valid Ant build script which packs up and prepares
I have an ant build script for a project which depends on an external
I have an ant script which produces a custom version of tomcat for use
I have an ANT script which will have a property whose value could be
i have written an ant script, which runs ok and generate the .jar file
I have this ant script which should create the table customer. I see the
I have a Java application which runs on an embedded device. Because different devices
I have an existing web application which I have been building with an ant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.