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 657723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:51:19+00:00 2026-05-13T22:51:19+00:00

I am working on a legacy Java Enterprise server project, trying to set up

  • 0

I am working on a legacy Java Enterprise server project, trying to set up nightly builds. We are using Java 5, Maven 2, JBoss 4.2 and Atlassian Bamboo 2.1.5. The idea is that we have a Bamboo agent on one of our dev servers, and the Maven build is configured to hard deploy the resulting .ear file, then restart the server. (We can’t use soft deploy because our legacy application uses a library which causes an exception during undeploy… we will get rid of that damn library at some point, but not just yet.) I am using the JBoss Maven plugin for this. It works nicely when I run a Maven build on my own machine (laptop, Win XP Professional): the server is stopped and restarted with the latest build, and the build finishes.

However, when I try to run the nightly build on our server (Win 2003), after starting the JBoss server the build process halts. The Bamboo agent displays in the log:

Build MYPROJECT-NIGHTLY-44 completed.

And then it waits there, the build never finishing – unless I shut down the JBoss server manually, at which point the Bamboo build process resumes and runs its post-build activities, then terminates with

Finished building MYPROJECT-NIGHTLY-44.

Apparently the process to start the JBoss server somehow locks the parent process on Win 2003, while the same process runs independently on Win XP. The relevant code of the JBoss plugin looks like this (reformatted for brevity):

protected void launch( String fName, String params )
    throws MojoExecutionException {

    try {
        checkConfig();
        String osName = System.getProperty( "os.name" );
        Runtime runtime = Runtime.getRuntime();

        Process p = null;
        if ( osName.startsWith( "Windows" ) ) {
            String command[] = { "cmd.exe", "/C", "cd " + jbossHome + "\\bin & " + fName + ".bat " + " " + params };
            p = runtime.exec( command );
            dump( p.getInputStream() );
            dump( p.getErrorStream() );
        } else {
            String command[] = { "sh", "-c", "cd " + jbossHome + "/bin; ./" + fName + ".sh " + " " + params };
            p = runtime.exec( command );
        }

    } catch ( Exception e ) {
        throw new MojoExecutionException( "Mojo error occurred: " + e.getMessage(), e );
    }
}

protected void dump( final InputStream input ) {
    new Thread( new Runnable() {
        public void run() {
            try {
                byte[] b = new byte[1000];
                while ( ( input.read( b ) ) != -1 ) {
                }
            } catch ( IOException e ) {
                e.printStackTrace();
            }
        }
    } ).start();
}

The dump() method is needed to flush the output buffers of the process – without it the process can’t run, as is documented in the API docs too. However, this still doesn’t work on Win 2003. Is there something missing or incorrect in this code? Is this a Bamboo issue? Any help is appreciated.

Update: I tested the Maven build from command line on the server and it works perfectly. So it is apparently a Bamboo issue. Looks like the Bamboo agent ties all subprocesses forked from its build process directly or indirectly, and waits until all of them terminates before declaring the build to be finished. Which sounds sort of logical for a build agent… just has unfortunate consequences for me 🙁

Update 2: I posted the issue on the Bamboo discussion board too, got some responses from an Atlassian support guy but no decisive results yet.

  • 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-05-13T22:51:19+00:00Added an answer on May 13, 2026 at 10:51 pm

    The outcome of my related discussion on the Bamboo forum is: this seems to be a feature of Bamboo, so there is no direct workaround. The suggested solution is to use the post build command plugin to deploy the application after the build process has finished.

    I have not tried this, as I found an alternative solution to deploy our server as a Windows service via Tanuki, using the Exec Maven Plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 386k
  • Answers 386k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think "ctags" is the wrong program. (I'm not sure… May 14, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer SQL 2000 lacks the sys.procedures system table - the closest… May 14, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer Add return false; to the Javascript event handler. (or e.preventDefault();… May 14, 2026 at 11:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.