JBoss start up configuration
- Published: 23 January 2011
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:
Windows users can use the equivalent command:
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:
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.
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.
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.
Create a file named test.properties:
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
- Next >>