• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

How to Start JBoss Application Server

How to Start JBoss Application Server

  1. To start JBoss, run $JBOSS_HOME/bin/run.sh on Unix/Linux and %JBOSS_HOME%\run.bat on Windows
  2. The script figures out JBOSS_HOME by itself – though it does not hurt to have it pre-specified.
  3. By default, this script runs the default configuration set
    1. Alternative configuration set can be specified: ./run.sh -c <configuration_set_name>
  4. By default, this script binds JBoss AS to 127.0.0.1 (for security reasons) making it inaccessible from the outside world
    1. To bind JBoss to a specific address, execute: ./run.sh -b 10.1.2.3 or ./run.sh –host=10.1.2.3
    2. To bind JBoss to all addresses, execute: ./run.sh -b 0.0.0.0 or ./run.sh –host=0.0.0.0
  5. To start JBoss as a system service
    1. On Unix/Linux, use a script like jboss_init_redhat.sh
      1. Copy (or symbolically link) this script to /etc/init.d/jboss
      2. Edit the script as needed (to specify user, IP, and file paths)
      3. Add #chkconfig: 3 80 20 and #description: JBoss to this script
      4. Run chkconfig –add jboss
    2. On Windows use JavaService (http://forge.objectweb.org/projects/javaservice/), which comes with an installation script for JBoss

Usage: run.bat [options]

options:

  • h, –help                   Show this help message
  • V, –version                 Show version information
  • –                           Stop processing options
  • D<name>[=<value>]           Set a system property
  • d, –bootdir=<dir>           Set the boot patch directory; Must be absolute or url
  • p, –patchdir=<dir>         Set the patch directory; Must be absolute or url
  • n, –netboot=<url>           Boot from net with the given url as base
  • c, –configuration=<name>   Set the server configuration name
  • B, –bootlib=<filename>     Add an extra library to the front bootclasspath
  • L, –library=<filename>     Add an extra library to the loaders classpath
  • C, –classpath=<url>         Add an extra url to the loaders classpath
  • P, –properties=<url>       Load system properties from the given url
  • b, –host=<host or ip>       Bind address for all JBoss services
  • g, –partition=<name>       HA Partition name (default=DefaultDomain)
  • m, –mcast_port=<ip>         UDP multicast port; only used by JGroups
  • u, –udp=<ip>               UDP multicast address
  • l, –log=<log4j|jdk>         Specify the logger plugin type

On Unix/Linux, run.sh (and shutdown.sh) source JVM/runtime options from run.conf file whereas on Windows run.bat specifies those options internally.

Interested in mastering JBOSS?
Learn more about JBOSS Tutorial in this blog post.

Verifying JBoss AS Startup

JBoss has successfully started when in its console window you can see a line like this:

13:26:33,625 INFO [ServerImpl] JBoss (Micro container) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 2m:20s:844ms

If you see any exception traces, then there was a problem starting one or more of the JBoss services. Examine the error messages before continuing. A common problem is a port conflict: another server (possibly another instance of JBoss AS itself) is running on one or more of the required JBoss AS ports.

Point your browser to http://localhost:8080/status to verify the server startup.

How to Stop JBoss Application Server

Stopping JBoss Application Server

If started in foreground using the run script, simply hit CTRL+C

If running in the background as an OS service, stop it just like any other OS service

  1. /etc/init.d/jboss stop (on UNIX/Linux)
  2. kill -TERM <jboss-pid> (on UNIX/Linux)
  3. NET STOP JBoss (on Windows)

Use the shutdown script (remote shutdown): $JBOSS_HOME/bin/shutdown.sh -S (shutdown.bat on Windows)

A JMX client to shutdown (exit or halt) a remote JBoss server.

Usage: shutdown [options] <operation>

options:

  • h, –help               Show this help message (default)
  • D<name>[=<value>]       Set a system property
  • –                       Stop processing options
  • s, –server=<url>       Specify the JNDI URL of the remote server
  • n, –serverName=<url>   Specify the JMX name of the ServerImpl
  • a, –adapter=<name>     Specify JNDI name of the MBeanServerConnection to use
  • u, –user=<name>         Specify the username for authentication
  • p, –password=<name>     Specify the password for authentication
  • operations:
  • S, –shutdown           Shutdown the server
  • e, –exit=<code>         Force the VM to exit with a status code
  • H, –halt=<code>         Force the VM to halt with a status code

To shutdown a remote JBoss AS instance, use: ./shutdown.sh -s jnp://remoteHostOrIP:1099 -S Remote instance’s IP address and port are specified by its Naming service configured in ${jboss.server.config.url}/jboss-service.xml

For indepth understanding on JBoss click on:

Summary
Review Date
Reviewed Item
How to Start JBoss Application Server
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on How to Start JBoss Application Server"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.