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?

2
  • 1
    Tail the log file, there will be an entry along the line of "startup completed in n seconds". Commented Mar 22, 2017 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. Commented Oct 19, 2018 at 0:24

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.