JBoss start up configuration

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

This short tutorial explains all the things you need to know about the startup process of JBoss AS, how to inject system properties in the application server and how to trace the logs of the start up activities. 

How to start JBoss EAP 6 and WildFly

You can start the application server in standalone mode using the following command from $JBOSS_HOME/bin:

$ standalone.sh        

Windows users can use the equivalent command:

standalone.bat 

You can bind the application server public interfaces to a different IP address using:

$ standalone.sh -Djboss.bind.address=192.168.0.1 

On the other hand, you can bind the application server management interfaces to a different IP address using:

$ standalone.sh -Djboss.bind.address.management=192.168.0.1

The above commands will start the application server using the default (standalone.xml) configuration file. If you want to use an alternate configuration, you have to include the -c parameter. In the following example, we are starting the application server in standalone mode using the standalone-ha.xml (clustering) configuration: 

$ standalone.sh -c standalone-ha.xml   

If you want to specify an offset for the server, then you can use the property jboss.socket.binding.port-offset as follows:

$ standalone.sh -Djboss.socket.binding.port-offset=100

In Domain mode, you can start the application server Domain as follows:

$ domain.sh

This will pickup the host.xml and domain.xml files from the domain/configuration folder. As an alternative, you can specify a different set of files on the command line:

$ domain.sh -domain-config=mydomain.xml -hostconfig=myhost.xml

Setting System Properties at Startup in WildFly and EAP 6

You have a wide set of options for setting System Properties in the most recent version of the aplication server. You can use the standard -D option, for example:

$ standalone.sh -Dmyproperty=value   

You can also use the -P parameter to point to an URL where properties are defined. For example:

$ standalone.sh -P http://somehost/some-location.properties

Finally, Properties can be set via the CLI as in the following example:

[standalone@host:9990 /] /system-property=foo:add(value=bar) 

How to start JBoss AS 5 and older versions

Starting the application server is just a matter of launching the start.cmd (Windows) or start.sh (Unix) script.

You can however customize the server startup using several parameters:

The option -b can be used to bind all server services to an IP Address.

For example:

run.sh -b 192.168.10.1        # Bind the server on the IP Address 192.168.10.1
run.sh -b 0.0.0.0                   # Bind the server on all network interfaces

The option -c can be used to choose which server configuration will be started. If not used the "default" will be chosen.

For example:

run.sh -c all                 # Starts the "all" server configuration

The options -B can be used to add an extra library to the front bootclasspath

This is equivalento to dropping a jar library into $JBOSS_HOME/lib.

The options -L can be used to add an extra library to the loaders classpath

This is equivalent to dropping a jar library into $JBOSS_HOME/common/lib.

You can set a system property through the
-D<name>=<value> option. You can also use the -P option to load the properties from a file.

Example:

Create a file named test.properties:

jboss.bind.address=0.0.0.0
jboss.service.binding.set=ports-default

launch JBoss AS with:

run.cmd -P test.properties

Applications using JGroups library might benefit from the -m and -u option.

-m sets the UDP multicast port; only used by JGroups. -u sets the UDP multicast address

Related articles available on mastertheboss.com

JBoss MBeans POJO

JMX MBean services are the core building blocks of the JBoss Appl

How to a dump of JNDI tree with JMX console ?

#2 JBoss Howto. This is the recipe of the day

How to configure JBoss to bind to a different IP ?

  If you want to change the jboss.bind.address property use the 

How to shut down JBoss from remote ?

JBoss recipe of the day

How to create multiple instances of an Mbean?

  Supposing you need two instances of an MBean, let's say one fo

JBoss classloader issues

By default JBoss (prior to version 3.2) uses a flat class loading

Follow us on Twitter