2

I have a simple "sanity-check" webapp that I wish to deploy on a JBoss EAP server as soon as it is started. But what does "started" mean? If my script that calls the jboss cli is launched too soon after JBoss reports it's done, I get a message saying

  {"WFLYDC0074: Operation failed or was rolled back on all servers. Server failures:" => {"server-group" => {"main-server-group" => {"host" => {"master" => {"master-1-server-1" => "WFLYCTL0379: System boot is in process; execution of remote management operations is not currently available"}}}}}}

How can I detect that JBoss is really ready to handle deployments?

Alternatively, is there a mechanism by which I can autodeploy something on startup?

  • 1
    Tail the log file, there will be an entry along the line of "startup completed in n seconds". – DopeGhoti Mar 22 '17 at 15:30
  • @Steve Cohen, did you figure out a better way to know when Jboss is really ready? I have the exact issue. Thank you. – user674669 Oct 19 '18 at 0:24
0
#!/bin/bash

while true
  do
    wildflyStarted=$(grep -ic "Wildfly.*started in.*ms.*Started.*of.*services" /opt/wildfly/standalone/log/server.log)
    if [[ "$wildflyStarted" -eq "1" ]]; then
      break;
    else
      sleep 1;
    fi
  done

while true
  do
    ejbcaStatus=$(/opt/wildfly/bin/jboss-cli.sh -c --commands="cd deployment,cd ejbca.ear,read-attribute status")
    if [[ "$ejbcaStatus" -eq "OK" ]]; then
      break;
    else
      sleep 5;
    fi
  done

This script worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.