Chapter 6. JOnAS Command Reference

Commands provided with JOnAS are described in this chapter.

6.1. jonas

6.1.1. Synopsis

jonas start [-fg | -bg | -win] [-n name]

start a JOnAS server

jonas stop [-n name]

Stop a JOnAS server.

jonas admin [-n name] [admin_options]

Administer a JOnAS server.

jonas check

Check the environment before running a JOnAS server.

jonas version

Print the current version of JOnAS.

6.1.2. Description

This command provides the capability to start, stop, or administer JOnAS servers.

The outcome of this program may depend on the directory from which the command is run (that is depending on the existence of a jonas.properties file in the current directory). It is possible to set system properties to the program by using the JAVA_OPTS environment variable, if required. Note that setting system properties with a -D option will always take precedence over the properties described in the other jonas.properties files.

The jonas script /usr/share/jonas/bin/unix/jonas can be reviewed and possibly modified for assistance with problems or for obtaining additional information.

There are five different sub-commands that depend on the first mandatory argument:

jonas start

Start a new JOnAS server. The process can be run in the foreground, in the background, or in a new window. If the background option is chosen (default option), control is given back to the caller only when the server is ready. The default name is jonas. A different name can be given with the -n option.

jonas stop

Stop a running JOnAS server. Use the -n option if the server was given a name other than the default name.

jonas admin

Administer a JOnAS server. Use the -n option if the server was given a name other than the default name. Used without any other option, this command will prompt the user for an administrative command (interactive mode). Each administrative command exists in a non-interactive mode, for use in applications such as shell scripts, for example. Refer to the option list for a description of each.

jonas check

Check the environment settings before running a JOnAS server. (This is a very basic troubleshooting test.)

jonas version

Print the current version of JOnAS.

6.1.3. Options

Each option may be pertinent only for a subset of the five different sub-commands. For example, jonas check and jonas version do not accept any options.

-n name

Give a name to the JOnAS server. The default is jonas. Used for start, stop, or admin.

-fg

Used for start only. The server is launched in the foreground: control is given back to the user only when the JOnAS server is stopped.

-bg

Used for start only. The server is launched in the background. Control is given back to the user only when the JOnAS server is ready. This is the default mode.

-win

Used for start only. The server is launched in a new window.

-?

Used for admin only. Prints a help with all possible options.

-a filename

Used for admin only. Deploys a new application described by filename inside the JOnAS Server. The application can be one of the following:

  • A standard EJB-JAR file. This leads to the creation of a new EJB Container in the JOnAS Server. If the file name has a relative path, this path is relative to where the EJB server has been launched or relative to the $JONAS_ROOT/ejbjars directory for an EJB-JAR file.

  • A standard WAR file containing a WEB Component. If the file name has a relative path, this path is relative to where the EJB server has been launched or relative to the $JONAS_ROOT/webapps directory for a WAR file.

  • A standard EAR file containing a complete J2EE application. If the file name has a relative path, this path is relative to where the EJB server has been launched or relative to the $JONAS_ROOT/apps directory for an EAR file.

-r filename

Used for admin only. Dynamically removes a previous -a filename command.

-gc

Used for admin only. Runs the garbage collector in the specified JOnAS server.

-passivate

Used for admin only. Passivates all Entity Bean instances. This affects only instances outside transaction.

-e

Used for admin only. Lists the properties of the specified JOnAS server.

-j

Used for admin only. Lists the registered JNDI names, as seen by the specified JOnAS server.

-l

Used for admin only. Lists the beans currently loaded by the specified JOnAS server.

-sync

Used for admin only. Synchronizes the Entity Bean instances on the current JOnAS server. Note that this affects only the instances that are not involved in a transaction.

-debug topic

Used for admin only. Sets the topic level to DEBUG.

-tt timeout

Used for admin only. Changes the default timeout for transactions. timeout is in seconds.

Each jonas admin option has its equivalent in the interactive mode. To enter interactive mode and access the following list of subcommands, type jonas admin [-n name] without any other argument. To exit from interactive mode, use the quit command.

Interactive CommandOnline Matching Command
addbeans-a fileName
env-e
gc-gc
help-?
jndinames-j
listbeans-l
removebeans-r fileName
sync-sync
trace-debug topic
ttimeout-tt timeout
quitexit interactive mode

6.1.4. Examples

jonas check
jonas start -n jonas1
jonas admin -n jonas1 -a bean1.jar
jonas stop -n jonas1