Troubleshooting a JBoss EAP Installation

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

Red Hat JBoss Enterprise Application Platform (EAP) is a Java EE-based cross-application platform built around deploying and managing Java applications and services. This hands-on lab explores troubleshooting common things that can go wrong during the installation of JBoss EAP on Red Hat Enterprise Linux 8.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install JBoss
  1. Run the installer located in the cloud_user‘s home directory:

    sudo java -jar jboss-eap-7.2.0-installer.jar -console
  1. Review installer:

    • Set the language.
    • Accept terms.
    • Set path (use /opt/jboss-eap to match default configuration).
    • Install all packages.
    • Set admin name (admin).
    • Set admin password.
    • Use the default configuration.
    • Choose whether to save an automatic installation script based on this install.
  2. Create the service user:

    sudo useradd --no-create-home --shell /bin/false/ jboss-eap
  3. Open the configuration file and uncomment the JBOSS_HOME and JBOSS_USER settings; save and exit.

    cd /opt/jboss-eap
    sudo vim bin/init.d/jboss-eap.conf
  4. Copy service files to the appropriate locations:

    sudo cp bin/init.d/jboss-eap.conf /etc/default/
    sudo cp bin/init.d/jboss-eap-rhel.sh /etc/init.d/
  5. Set script as an executable:

    sudo chmod +x /etc/init.d/jboss-eap-rhel.sh
  6. Set the service to start automatically:

    sudo chkconfig --add jboss-eap-rhel.sh
    sudo chkconfig jboss-eap-rhel.sh on
  7. Attempt to start JBoss EAP:

    sudo systemctl start jboss-eap-rhel

    The service start should fail.

Determine Cause of Failure (SELinux)
  1. Begin troubleshooting by viewing the journalctl log, as suggested in the output:

    journalctl -xe | less
  1. Scroll towards the bottom of the logs. Look for a line stating:

    SELinux is preventing jboss-eap-rhel. from
    create access on the file console.log.
  2. We’ll need to update SELinux to allow JBoss. Luckily, instructions for this are included in the log itself. Note that we’ll have to adjust the commands to use sudo:

    sudo ausearch -c 'jboss-eap-rhel.' --raw | sudo audit2allow -M jboss-eap-rhel
    sudo semodule -X 300 -i jboss-eap-rhel.pp
  3. Attempt to start JBoss once more:

    sudo systemctl start jboss-eap-rhel

    Once more, it will fail.

Determine Cause of Failure (Permissions)
  1. Rerun the journalctl command:

    journalctl -xe | less
  1. Once more, scroll towards the bottom. Here we can see a permissions error:

    Starting jboss-eap: chown: missing operand after ‘/var/run/jboss-eap’
  2. We’ll need to ensure our jboss-eap user can access the /var/run/jboss-eap directory:

    sudo chown -R jboss-eap:jboss-eap /var/run/jboss-eap
  3. Attempt another service start:

    sudo systemctl start jboss-eap-rhel

    Yet again, it fails.

Determine Cause of Failure (JBoss Logs)
  1. Should we check the logs this time, what we’re given is not very helpful. Instead, we want to look at JBoss’s logs themselves, found at /var/log/jboss-eap:

    cat /var/log/jboss-eap/console.log

    Note that not all log content will be here. This is because our jboss-eap user doesn’t have permissions for this directory:

    ls -al /var/log/jboss-eap/
  2. Change the ownership for this directory:

    sudo chown -R jboss-eap:jboss-eap /var/log/jboss-eap
  3. Rerun the start command:

    sudo systemctl start jboss-eap-rhel
  4. Now we can review our logs:

    less /var/log/jboss-eap/console.log
  5. Notice that we cannot create a directory in /opt/jboss-eap — this also needs to have its ownership updated:

    sudo chown -R jboss-eap:jboss-eap /opt/jboss-eap
  6. Start the service:

    sudo systemctl start jboss-eap-rhel

Additional Resources

You have been tasked with setting up JBoss Enterprise Application Platform to support your company's Java-based point-of-sale system offering. Your company uses Red Hat Enterprise Linux 8, and you intend to follow the basic instructions for installing JBoss via JAR to get it up and running.

Note that Java (OpenJDK 11) has already been installed in the provided environment.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?