Sun ONE Application Server 7 Administrator's Guide |
Appendix A
Using the Command Line InterfaceThis appendix provides instructions for using the command line interface (the asadmin utility), in singlemode (that is, you run one command at a time from the command prompt) at the system prompt, in multimode (that is, you can run multiple commands without needing to reenter environment-level information), and in scripts and programs. You can use the command line interface in place of the Administration interface screens.
This appendix contains the following sections:
About the Command Line InterfaceThis section contains the following topics:
About the asadmin Utility
The asadmin utility performs all configuration and administration tasks. You can use this utility in place of using the Administration interface.
About Ant Tasks
Many developers use Ant to accelerate the development process for J2EE applications. Ant scripts leverage the asadmin utility for some tasks. Developers use the Ant tasks for building applications, deploying and undeploying modules and applications and for controlling the Sun ONE Application Server.
For more information on the Ant tasks, see the Sun ONE Application Server Developer’s Guide.
For more information on Ant, see the Jakarta Project site at http://jakarta.apache.org/ant/.
About Other Command Line Utilities
Sun ONE Application Server contains additional command line utilities. The following table lists the utilities and gives a brief description of each one.
For more information on these utilities, see their online help.
Using asadminThe asadmin utility has a set of commands for performing administrative tasks. You can use these commands to most of the tasks that you can perform using the Administration interface. You can find the asadmin utility at install_dir/bin and run it from there. On Windows, double-click the asadmin.bat file and the asadmin utility launches in a command window, running in multimode.
Please note that some HTTP-server-related properties and the Administration Server properties cannot be set using the command line; they must be set using the Administration interface. You can set all properties stored in the server.xml configuration file, but not the ones stored in init.conf or obj.conf. For more information on the configuration files, see the Sun ONE Application Server Administrator’s Configuration File Reference.
For more information on individual commands, see "Command Reference" and the help for the commands.
This section contains the following topics:
Understanding the Command Syntax
The asadmin utility has the following syntax:
asadmin command -short-option argument --long-option argument operand
Command
The command is the operation or task performed. The command is case-sensitive.
Options
Options modify how the utility performs a command. Options are case-sensitive. Notice that the short options have a single dash (-) in front of them, and the long options have two dashes (--) in front of them. For many options, you can use either a long or short form; for example, user can be either --user or -u. Some options are required and some are optional. Optional options are shown in brackets in a command’s syntax. You must include all required options when you run a command or you receive an error message and the command does not execute.
For a list of available long and short option names available see the "Short and Long Options, Default Values, and Environment Variables" table in "Command Reference".
Most options require argument values, for example --port port_number. The exceptions are boolean options, which toggle to switch a feature on or off and don’t require argument values.
You can also save options in the environment variables. For more information, see "Using the Environment Commands". For a complete list of the environment variable equivalent of options, see "Long and Short Option Formats, Default Values, and Environment Variable Equivalents".
Boolean Options
A boolean options toggles on or off (for example --interactive puts you in interactive mode where you are prompted for options; --no-interactive turns off interactive mode). Putting --no- in front of the long option toggles the option off. Specifying the short option name always sets the opposite of the default value.
You can group short boolean options. For example, you can use -Ie to specify interactive (short option -I) and echo (short option -e).
Operands
Operands are set off by a space or a tab. They can come in any order in the command syntax. You can use -- with no option after it to separate the options from the operands. Any following arguments are treated as operands, even if they begin with a dash (-). For example, in
asadmin> create-jvm-options --instance server1 -- -Xmx1500m
-XMx1500m is treated as an operand, even though it begins with a dash.
Syntax Example
asadmin create-instance [--user admin_user] [--password admin_password] [-H host_name] [--port port_number] [--sysuser sys_user] [--domain domain_name] [--local=true/false] [--passwordfile file_name] [--secure | -s] --instanceport instance_port instance_name
In this syntax example -H is the short option for hostname, --user is a long option with admin_user as its argument, and instance_name is an operand. Optional options are inside brackets.
The following example shows the syntax with real values. Some of the optional options are not used in the example.
asadmin create-instance --user admin --password password -H austen --port 4848 --instanceport 1024 server2
Using Singlemode and Multimode
You can run asadmin either in singlemode or multimode. In singlemode you run one command at a time from the command prompt. In multimode you can run multiple commands without needing to reenter environment-level information.
If you are using input from a file, and a command fails, in singlemode the program exits. If you are using multimode and a command fails, you return to the asadmin prompt.
Singlemode
If you invoke a single command in the command line interface from a command prompt, you are running in singlemode. The command line interface runs the command and exits back to the command prompt. To run the command line interface from a command prompt, go to the directory install_dir/appserv/bin and type your command at the command prompt:
> asadmin command options arguments
For example:
> asadmin create-instance --user admin --password password -H austen --port 4848 --instanceport 1024 server2
Multimode
Multimode lets you set your environment at the outset so that you can run multiple commands without needing to re-enter certain environment-level information, such as your server name, port, and your password. One significant advantage of using multimode is that commands can be entered end executed significantly faster, since asadmin stays in memory. If these environment variables are set at the operating system level, multimode picks up those settings. The asadmin utility uses these settings until you change them.
On Windows, you are automatically in multimode when you run the asadmin.bat file.
On UNIX, to start the asadmin utility in multimode from the command line, type:
> asadmin multimode
When you are in multimode, the command prompt changes to asadmin. You can then type your commands into the asadmin prompt. You do not need to use the utility name. For example:
asadmin> create-instance --user admin --password password -H austen --port 4848 --instanceport 1024 server2
Exit multimode by typing exit or quit. You return to the command prompt.
Multiple Multimode
You can also invoke multimode from within a multimode session, by using the command:
asadmin> multimode
Once you exit the second multimode environment, you return to your original multimode environment.
For example, if you are administering server1 in multimode, and you want to administer server2 to compare the two, you can invoke multimode for server2 from within multimode for server1. Because you do not need to exit your current multimode session, you can retain your environment settings. When you exit the multimode session you’re using for server2, you return to your server1 multimode environment.
Using Interactive and Non-Interactive Options
When you use the command line interface, you can use it in interactive or non-interactive mode. If you choose to use interactive mode, you are prompted for the password if you don’t specify it. Interactive mode is enabled by default.
You can disable and enable interactive mode by setting the interactive environment variable using the export command. For more information, see the "Environment Variables Used with export Command" table.
You can use the interactive option in singlemode under all circumstances. You can use the interactive option in multimode when you run one command at a time from the command prompt, and when you run in multimode from a file. However, commands in multimode when piped from an input stream and commands invoked from another program cannot run in interactive mode.
Using the Environment Commands
The asadmin utility contains a set of environment variables that you can set using environment commands. In multimode, once you set these variables you do not need to reset your environment until you exit multimode. You can also set these environment variables at the operating system level; if you do, they are automatically picked up when you enter multimode and they persist after you exit from multimode.
Environment variables are name/value pairs that you can set at any time by assignment. Environment variable constitutes of AS_ADMIN_ prefix to the option name in capitals. For example, to set the Administration Server user, you can type:
export AS_ADMIN_USER=administrator
Where administrator is the administrator’s username.
This also makes the value for AS_ADMIN_USER available to asadmin commands; for example:
asadmin multimode
asadmin> export AS_ADMIN_HOST=austenFor as long as you are in this multimode session, the Administration Server hostname is set to austen, unless you reassign it.
You can also set and export values for multiple environment variables in one step, for example:
asadmin> export AS_ADMIN_PORT=4848 AS_ADMIN_USER=admin
To see your current environment variable settings, use the export command without arguments:
asadmin> export
AS_ADMIN_HOST=austen
AS_ADMIN_PORT=4848
AS_ADMIN_USER=adminUse the unset command to remove a variable and its value from the environment. For example:
asadmin> unset AS_ADMIN_HOST
You can override the set value for an environment variable either by resetting the variable, or by setting a different value as part of an asadmin command. For example:
asadmin> export AS_ADMIN_HOST=dickens
asadmin> show-instance-status --host austen instance-nameThis example shows the instance status for an instance in the Administration Server host austen, because that value overrides the earlier host value of dickens.
If you do not use exported variables, you must provide the following options with most commands or use the default values (for a list of default values, see "Long and Short Option Formats, Default Values, and Environment Variable Equivalents"):
The following table, "Environment Variables Used with export Command," describes some of the environment variables to use with the export command. These variables are the most commonly used, as they specifically deal with setting up the environment. The first column shows the environment variable name, and the second column shows what it is used for, and the default value if none is set. For a complete list of the environment variables, see "Long and Short Option Formats, Default Values, and Environment Variable Equivalents"
Using the Password File Option
If you do not want to type the passwords on the command line or set environment variables for the passwords, you can create a password file and use it as an option from the command line.
Every command which has the a password option also has the passwordfile option that you can use instead. The password file contains the following lines:
AS_ADMIN_PASSWORD=value
AS_ADMIN_ADMINPASSWORD=value
AS_ADMIN_USERPASSWORD=value
If you use the passwordfile option, the passwords in the file are exported to the multimode environment, and subsequent commands without the password options specified use these values.
If you specify both a password and a password file option at the command line, the values in the password file are exported to the multimode environment, but the current command uses the password specified in the password option, because the password option takes precedence over the password file.
Running asadmin Locally or Remotely
Usually the asadmin utility sends its commands through the Administration Server. Therefore, you do not need to run asadmin on the system where the Sun ONE Application Server is installed. However, the Administration Server must be running in order for most asadmin commands to work.
Some commands have the option of being run locally, for example, create-instance. If you use the --local=true option with create-instance, you must run it on the machine where the server is installed, but you do not need to have the Administration Server running in order to create the instance.
Some commands must be run locally. For example, start-appserv, which starts the Administration Server and all its instances, cannot be run remotely because the Administration Server is not running until the command starts it.
For more information on the Administration Server, see Chapter 2, "Setting Administration Server Preferences."
The following commands can be run both locally and remotely:
For these commands, you can choose to run a command locally without specifying the local option. By default, if you specify a value for user, password, host, or port in the command syntax the command is treated as a remote command (though you can still specify local values for these options). If you do not specify values for these options, the command is run locally by default.
When a command is executed locally, if there is a domain option it is required by the command (unless there is only one domain).When a command is executed remotely it ignores the domain option if you specify it.
Using Command Line Invocations
You can invoke a command line in many ways, as described in the following topics:
Using asadmin from the Command Line
The simplest way to use the commands is one at a time, from the command line. You type in the utility, command, its options and arguments. In multimode you type multiple commands without needing to retype the utility name and environment options (if you have set the environment variables). You can run either singlemode or multimode commands interactively (prompted for additional required input, for example, a password) or non-interactively.
For more information on singlemode and multimode, see "Using Singlemode and Multimode".
For more information on using commands interactively, see "Using Interactive and Non-Interactive Options".
Example from Command Line
> asadmin create-instance --user admin --password password --host austen --port 4848 --instanceport 1024 server2
After the command completes, you return to the operating system prompt.
Using asadmin with Input from a File (Script)
You can create a script which includes many asadmin commands. With scripts you can process commands in a batch, set up a job to run at specific times, and otherwise simplify and automate your administration tasks.
To call a script that is in a file, use the syntax:
> asadmin multimode --file filename
The following is an example of a simple script in a file that you can call in this manner:
# Create new instance and start it.
export AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=mypassword AS_ADMIN_HOST=austen AS_ADMIN_PORT=4848
create-instance --instanceport 9000 austen3
start-instance austen3This script sets the environment, creates an instance called austen3 and starts the new instance. Lines that begin with a number sign (#) are treated as comments and ignored.
Using asadmin with Standard Input (Pipe)
You can pipe input into the asadmin utility using the following syntax:
cat filename | asadmin multimode
This syntax may not work on Windows.
Using Escape Characters
Some characters, the colon (:), the asterisk (*), and the backslash (\), cause errors if you use them in the command syntax unless you use escape characters to set them off. The possibilities for using escape characters vary depending upon what platform you use and whether you use singlemode or multimode.
This section contains the following topics:
Escape Characters on UNIX in Singlemode
On Solaris, you can use either two backslashes (\\) or double-quotes (“ ”) to escape restricted characters.
Escape with Backslashes (\\)
For example, when creating a JDBC connection pool with a option whose value includes colons, you could use backslashes (example assumes the environment variables have been set for some properties):
asadmin create-jdbc-connection-pool --instance server1 --datasourceclassname oracle.jdbc.pool.OracleDataSource --failconnection=true --isconnectvalidatereq=true --property url=jdbc\\:oracle\\:thin\\:@asperfsol8\\:1521\\:V8i:user=staging_lo okup_app:password=staging_lookup_app OraclePoollookup
Escape with Quotes
To use quotes in the same example as above, you would enclose the value in double quotes (”) and escape the double quotes with the backslash.
asadmin create-jdbc-connection-pool --instance server1 --datasourceclassname oracle.jdbc.pool.OracleDataSource --failconnection=true --isconnectvalidatereq=true --property url=\"jdbc:oracle:thin:@asperfsol8:1521:V8i\":user=staging_lookup_a pp:password=staging_lookup_app OraclePoollookup
You can also use the methods described in "Escape Characters on All Platforms in Singlemode".
Escape Characters on Windows in Singlemode
On windows, you can escape using the backslash character. For example, when creating a JDBC connection pool with a option whose value includes colons, you could use backslashes (example assumes the environment variables have been set for some properties):
asadmin create-jdbc-connection-pool --instance server1 --datasourceclassname oracle.jdbc.pool.OracleDataSource --failconnection=true --isconnectvalidatereq=true --property url=jdbc\:oracle\:thin\:@asperfsol8\:1521\:V8i:user=staging_lookup_ app:password=staging_lookup_app OraclePoollookup
You can also use the methods described in "Escape Characters on All Platforms in Singlemode".
Escape Characters on All Platforms in Singlemode
On any platform, you can use backslashes to escape the character and enclose the value containing the escaped characters in double quotes. For example, when creating a JDBC connection pool with a option whose value includes colons, you could use the escape characters as follows (example assumes the environment variables have been set for some properties):
asadmin create-jdbc-connection-pool --instance server1 --datasourceclassname oracle.jdbc.pool.OracleDataSource --failconnection=true --isconnectvalidatereq=true --property url="jdbc\:oracle\:thin\:@iasperfsol8\:1521\:V8i":user=staging_look up_app:password=staging_lookup_app OraclePoollookup
Escape Characters on All Platforms in Multimode
In multimode you can use the following syntax, which only requires quotes, not slashes or backslashes:
asadmin> create-jdbc-connection-pool --instance server1 --datasourceclassname oracle.jdbc.pool.OracleDataSource --failconnection=true --isconnectvalidatereq=true --property url="jdbc:oracle:thin:@asperfsol8:1521:V8i":user=staging_lookup_app :password=staging_lookup_app OraclePoollookup
Using get and set Commands
Use the get and set commands to access and change configuration settings in the Sun ONE Application Server. In most cases, asadmin commands only set the required properties. Use the set command to change values for optional properties.
Table A-3 get and set Commands
Command
Arguments
Use
get
(scope) where scope represents an attribute and is a valid name.
Gets the value of the attribute.
set
(scope=value) where scope represents an attribute and is a valid name, and value is the value you want to set for that attribute.
Sets the value of the attribute.
reconfig
instance-name
After running any command that modifies the configuration files, you need to run reconfig in order for the changes to be applied to the server. For more information on applying changes/reconfiguring the server, see "Applying Changes to an Application Server Instance".
You can get or set multiple attribute values in a single command by using spaces between the attributes. For example:
set server1.appReloadPollInterval=20 server1.mime.mime1.file=mime.types
You can also use the AS_ADMIN_PREFIX environment variable to set a prefix that will be used by subsequent get and set commands. A period (“.”) is implicitly inserted between the prefix string and the operand in the get and set commands. For example:
asadmin>export AS_ADMIN_PREFIX=server1
asadmin>get *
server1.locale = en_US
server1.appReloadPollInterval = 2
server1.name = server1
...Because the get and set commands require period separators, if an item contains periods in its name you must use the escape character backslash (\) before them. The following example shows a server instance name server2.sun.com with the periods preceded by backslashes:
get server2\.sun\.com.*
If you do not include the backslashes, you get an error message.
get and set Command Examples
The following examples show how to use the get command to get the values of attributes, and how to use the set command to set values.
MDB Container Service Example
If the application server instance is server1, you can get the values of all mdb-container attributes by using the following command in multimode, with your environment set:
asadmin> get server1.mdb-container.*
The following is an example of the output from this command, showing current values for the attributes:
server1.mdb-container.logLevel = null
server1.mdb-container.steadyPoolSize = 10
server1.mdb-container.idleInPoolTimeoutInSeconds = 600
server1.mdb-container.maxPoolSize = 60
server1.mdb-container.monitoringEnabled = false
server1.mdb-container.poolResizeQuantity = 2To get just the value of the MDB container attribute monitoringEnabled, use the following:
asadmin> get server1.mdb-container.montioringEnabled
To set the value of the monitoringEnabled attribute to true, use the following:
asadmin> set server1.mdb-container.montioringEnabled=true
JMS Resource Example
For configuring any of the resources, the attribute should look like:
instancename.resource.primary_key_value.attribute_name
For example:
asadmin> get server1.jms-resource.myjms.*
Gets all the attributes for the JMS destination resource called myjms. For example:
server1.jms-resource.myjms.resType = javax.jms.Topic
server1.jms-resource.myjms.enabled = true
server1.jms-resource.myjms.name = myjms
server1.jms-resource.myjms.description = nullTo get the value for a single attribute, for example resType:
asadmin> get server1.jms-resource.myjms.resType
To set an attribute, for example description:
asadmin> set server1.jms-resource.myjms.description=mydescription
This example sets the description to mydescription.
Getting and Setting Multiple Values Examples
You can get and set multiple values with the same command. To set two attributes at the same time, separate the attributes by spaces. For example:
set server1.appReloadPollInterval=20 server1.mime.mime1.file=mime.types
Also, you can use the environment variable AS_ADMIN_PREFIX to set a prefix to use for a number of get and set commands.
Monitoring Using get and set Commands
You can also use the get and set commands to monitor a running server. A list command also exists for monitoring. You can set an option, monitor, to true or false. If set to true, you monitor the attributes specified. For more information on using the command-line interface to monitor the Sun ONE Application Server, see "Extracting Monitoring Data Using the CLI".
Using Help
Help for every asadmin command is available from the command prompt by typing -h or --help. For example, for help on asadmin, type:
asadmin --help
You see a list of all asadmin commands.
To get a help for a specific asadmin command, type:
asadmin command -h
or
asadmin command --help
The help contains a synopsis, a description of the command, syntax information, examples, and a list of related commands.
Please note that if you use -h or --help anywhere in a command, you will get help for the command. The command will not execute.
You can also access the command-line help pages as manpages in a UNIX environment. For an unbundled installation, add install_dir/man to your MANPATH environment variable. Once this is done, you can access manpages for Sun ONE Application Server utilities, for example, by typing man asadmin at the command prompt.
Viewing Output and Errors
When a command executes successfully, you see a message informing you of what was done. If the command fails, you see an error message.
This section contains the following topics:
Viewing the Exit Status
In addition to an error message, asadmin commands always exit with an exit status. The exit status is 0 if the command is successful and 1 if the command fails.
Exit Status on UNIX
You can check for the exit status at the command prompt by typing echo $?.
You can also use the exit codes in scripting; for example, the following Korn shell script uses the exit status to indicate whether the list-instances command succeeded or failed:
#!/bin/ksh
asadmin list-instances
if [[ $? = 0 ]]
then
echo "success"
else
echo "error"
fiExit Status on Windows
On Windows you can check the exit status in your .bat scripts. For example, the following two scripts show a successful script and the output it returns, and an unsuccessful script and the output it returns:
Success Condition
myscript.bat
------------
echo off
echo Processing Command
call asadmin list-instances --domain domain1
if not %errorlevel% EQU 0 goto end
echo Command Succesful
goto program-end
:end
echo Command Failed
:program-endOutput:
Processing Command
admin-server <not running>
server1 <not running>
Command SuccesfulError Condition
myscript.bat
-------------
echo off
echo Processing Command
call asadmin list-instances
if not %errorlevel% EQU 0 goto end
echo Command Succesful
goto program-end
:end
echo Command Failed
:program-endOutput:
Processing Command
No default domain. Need to enter a domain.
Command FailedViewing Usage
If you type the command without arguments, you get an error message that includes the syntax for the command. For example:
asadmin> create-instance
Invalid number of operands received
USAGE: create-instance [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--sysuser sys_user] [--domain domain_name] [--local=false] [--passwordfile file_name] [secure | -s] --instanceport instanceport instancename
Security ConsiderationsWhen you run the command line interface from a command line, you must supply your password with all commands. If you are running in multimode, you must supply your password initially when you set up the environment. If you exit multimode, when you start multimode again you must set up your environment again, including your password. You set passwords using the environment commands. For more information see "Using the Environment Commands".
You can also set up a password file so you do not need to type your passwords at the command line. For more information, see "Using the Password File Option".
Without the authentication information of a valid username and password, the commands will not execute.
The command line interface has the security measures you’ve set up for your Sun ONE Application Server. For more information regarding security in the Sun ONE Application Server, see the Sun ONE Application Server Administrator’s Security Guide.
Concurrent Access ConsiderationsIt is possible that more than one person could attempt to configure a server concurrently using the command line interface and/or the Administration interface. If that happens, the second configuration request is queued until the first one completes. If the request is queued for too long, it times out.
For some commands, the changes don’t take effect until you use the reconfig command. That means more than one person could edit an attribute before the changes are applied to the server. For more information on reconfig, see "Applying Changes to an Application Server Instance".
Command ReferenceThis section contains the following topics:
List of Commands
The following table shows all the asadmin commands and their purpose. For more information on a command’s syntax and usage, see the online help.
The left column shows the command name, and the right column shows its use.
List of Dotted Names and Attributes
When you use the get and set commands to get and set attributes, you need to know the names asadmin uses for the services, resources, and so forth so you can use the name to get the attributes for that particular object.
Because the syntax for using these names involves separating names between periods, these names are called dotted names.
Dotted Names Used in asadmin
The following tables list the names used to configure items using the asadmin. They are broken out into the following categories:
Service Names
The following table shows the service names to use to get and set attributes for the services:
Resource Names
The following table shows resource names to use to get and set attributes for the resources. Note that these names are not valid by themselves; they require the name of a resource to follow the resource name.
Application Names
The following table shows the dotted names to use to get and set attributes application-related configuration. Note that these names are not valid by themselves; they require the name of the application to follow.
Table A-7 Application Names for Command-Line Interface
Application Component
Dotted Name
Application configuration
EJB module configuration
Web module configuration
Connector module configuration
Other Names
The following table shows the dotted names of other items you can configure using get and set. Note that these names are not valid by themselves; they require the name of the application to follow; for example, http-listener.listener_name, lifecycle-module.module-name, etc.
Attributes
The following sections show the attributes for each named item listed above, and provide usage examples. Note that some attributes are read-only (that is, they can only be used with the get command, not the set command).
Note
The examples in this section assume the user, password, host and port are defined in the environment variables, and don’t list those options in the syntax.
jms-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.jms-service.*
To get an attribute called adminPassword:
asadmin> get server1.jms-service.adminPassword
To set an attribute called adminPassword to a value of admin:
asadmin> set server1.jms-service.adminPassword=admin
transaction-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.transaction-service.*
To get an attribute called transactionRecoveryTimeout:
asadmin> get server1.transaction-service.transactionRecoveryTimeout
To set an attribute called transactionRecoveryTimeout to a value of 49:
asadmin> set server1.transaction-service.transactionRecoveryTimeout=49
mdb-container
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.mdb-container.*
To get an attribute called steadyPoolSize:
asadmin> get server1.mdb-container.steadyPoolSize
To set an attribute called steadyPoolSize to a value of 10:
asadmin> set server1.mdb-container.steadyPoolSize=10
ejb-container
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.ejb-container.*
To get an attribute called maxPoolSize:
asadmin> get server1.ejb-container.maxPoolSize
To set an attribute called maxPoolSize to a value of 12:
asadmin> set server1.ejb-container.maxPoolSize=12
web-container
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-13 Web Container Attributes
server.xml Name
asadmin Name
log-level
logLevel
monitoring-enabled
monitoringEnabled (not used)
To get all the attributes from an instance (server1):
asadmin> get server1.web-container.*
To get an attribute called logLevel:
asadmin> get server1.web-container.logLevel
To set an attribute called monitoringEnabled to be WARNING:
asadmin> set server1.web-container.logLevel=WARNING
java-config
The following table shows the sserver.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.java-config.*
To get an attribute called classpathprefix:
asadmin> get server1.java-config.classpathprefix
To set an attribute called classpathprefix to a value of com.sun:
asadmin> set server1.java-config.classpathprefix=com.sun
orb or iiop-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.orb.*
or
asadmin> get server1.iiop-service.*
To get an attribute called msgSize:
asadmin> get server1.orb.msgSize
or
asadmin> get server1.iiop-service.msgSize
To set an attribute called idleThreadTimeout to 300:
asadmin> set server1.orb.idleThreadTimeout=300
or
asadmin> set server1.iiop-service.idleThreadTimeout=300
orblistener or iiop-listener
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.orblistener.orb_listener_id.*
or
asadmin> get server1.iiop-listener.orb_listener_id.*
To get an attribute called port:
asadmin> get server1.orblistener.orb_listener_id.port
or
asadmin> get server1.iiop-listener.orb_listener_id.port
To set an attribute called address to bluestar:
asadmin> set server1.orblistener.orb_listener_id.address=bluestar
or
asadmin> set server1.iiop-listener.orb_listener_id.address=bluestar
log-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.log-service.*
To get an attribute called level:
asadmin> get server1.log-service.level
To set an attribute called echoToStderr to true:
asadmin> set server1.log-service.echoToStderr=true
security-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.security-service.*
To get an attribute called anonymousRole:
asadmin> get server1.security-service.anonymousRole
To set an attribute called encryptPasswords to true:
asadmin> set server1.security-service.auditEnabled=true
http-service
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.http-service.*
To get an attribute called bandwidthLimit:
asadmin> get server1.http-service.bandwidthLimit
To set an attribute called qos-enabled to true:
asadmin> set server1.http-service.qos-enabled=true
jdbc-resource
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-20 JDBC Resource Attributes
server.xml Name
asadmin Name
jndi-name
name
pool-name
pool
enabled
enabled
description
description
To get all the attributes from an instance (server1):
asadmin> get server1.jdbc-resource.jdbc_resource_name.*
To get an attribute called pool:
asadmin> get server1.jdbc-resource.jdbc_resource_name.pool
To set an attribute called enabled to true:
asadmin> set server1.jdbc-resource.jdbc_resource_name.enabled=true
jndi-resource
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-21 JNDI Resource Attributes
server.xml Name
asadmin Name
jndi-name
name
jndi-lookup-name
LookupName
res-type
resType
factory-class
factory
enabled
enabled
description
description
To get all the attributes from an instance (server1):
asadmin> get server1.jndi-resource.jndi_name.*
To get an attribute called factory:
asadmin> get server1.jndi-resource.jndi_name.factory
To set an attribute called factory to com.sun:
asadmin> set server1.jndi-resource.jndi_name.factory=com.sun
jdbc-connection-pool
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.jdbc-connection-pool.pool_name.*
To get an attribute called dsClassName:
asadmin> get server1.jdbc-connection-pool.pool_name.dsClassName
To set an attribute called resizeValue to 2:
asadmin> set server1.jdbc-connection-pool.pool_name.resizeValue=2
custom-resource
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-23 Custom Resource Attributes
server.xml Name
asadmin Name
jndi-name
name
res-type
resType
factory-class
factory
enabled
enabled
description
description
To get all the attributes from an instance (server1):
asadmin> get server1.custom-resource.jndi_name.*
To get an attribute called factory:
asadmin> get server1.custom-resource.jndi_name.factory
To set an attribute called factory:
asadmin> set server1.custom-resource.jndi_name.factory=myclass
jms-resource
The following table shows the sserver.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-24 JMS Resource Attributes
server.xml Name
asadmin Name
jndi-name
name
res-type
resType
enabled
enabled
description
description
To get all the attributes from an instance (server1):
asadmin> get server1.jms-resource.jms_resource_name.*
To get an attribute called res-type:
asadmin> get server1.jms-resource.jms_resource_name.resType
To set an attribute called enabled to true:
asadmin> set server1.jms-resource.jms_resource_name.enabled=true
persistence-manager-factory-resource
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.persistence-manager-factory-resource.jndi_name
To get an attribute called factoryClass:
asadmin> get server1.persistence-manager-factory-resource.jndi_name.factoryClass
To set an attribute called enabled to true:
asadmin> set server1.persistence-manager-factory-resource.jndi_name.enabled=true
mail-resource
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.mail-resource.jndi_name.*
To get an attribute called host:
asadmin> get server1.mail-resource.jndi_name.host
To set an attribute called enabled to true:
asadmin> set server1.mail-resource.jndi_name.enabled=true
application
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-27 Application Attributes
server.xml Name
asadmin Name
name
name
location
location
virtual-servers
virtualServers
description
description
enabled
enabled
To get all the attributes from an instance (server1):
asadmin> get server1.application.application_name.*
To get an attribute called location in an application:
asadmin> get server1.application.application_name.location
To set an attribute called location:
asadmin> set server1.application.application_name.location=
"/export/home/as7se/as1/repository/applications/ASConverter"ejb-module
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-28 EJB Module Attributes
server.xml Name
asadmin Name
name
name
location
location
description
description
enabled
enabled
To get all the attributes of stand-alone EJB module in an instance (server1):
asadmin> get server1.ejb-module.ejb_jar_name.*
To get all the attributes of an EJB module in an application for an instance (server1):
asadmin> get server1.j2ee-application.application_name.ejb-module.ejb_jar_name.*
or
asadmin>get server1.application.application_name.ejb-module.ejb_jar_name.*
To get an attribute called location from a stand-alone EJB module:
asadmin> get server1.ejb-module.ejb_jar_name.location
To get an attribute called location from an EJB module in an application:
asadmin> get server1.j2ee-application.application_name.ejb-module.ejb_jar_name.
locationor
asadmin> get server1.application.application_name.ejb-module.ejb_jar_name.location
To set an attribute called location in the stand-alone EJB module:
asadmin> set server1.ejb-module.ejb_jar_name.location="/export/home/as7se/as1/repos itory/modules/ejb_jar_name"
To set an attribute called location in the EJB module bundled into an application:
asadmin> set server1.j2ee-application.application_name.ejb-module.ejb_jar_name.
location="/export/home/as7se/as1/repository/modules/ejb_jar_name"or
asadmin>set server1.application.application_name.ejb-module.ejb_jar_name.location="/ex port/home/as7se/as1/repository/modules/ejb_jar_name"
web-module
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-29 WEB Module Attributes
server.xml Name
asadmin Name
name
name
location
location
context-root
contextRoot
virtual-servers
virtualServers
description
description
enabled
enabled
To get all the attributes of stand-alone web module in an instance (server1):
asadmin> get server1.web-module.web_war_name.*
To get all the attributes of a web module in an application for an instance (server1):
asadmin> get server1.web-module.application_name.web_war_name.*
To get an attribute called location from stand-alone web module:
asadmin> get server1.web-module.web_war_name.location
To get an attribute called location from the web module in an application:
asadmin> get server1.web-module.application_name.web_war_name.location
To set an attribute called location in the standalone web module:
asadmin> set server1.web-module.war-ic.location=
"/export/home/as7se/as1/repository/modules/web_war_name"To set an attribute called location in the web module bundled into an application:
asadmin> set server1.web-module.application_name.web_war_name.location=
"/export/home/as7se/as1/repository/modules/web_war_name"connector-module
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-30 Connector Module Attributes
server.xml Name
asadmin Name
name
name
location
location
description
description
enabled
enabled
To get all the attributes of standalone connector module in an instance (server1):
asadmin> get server1.connector-module.connector_rar_name.*
To get an attribute called location from standalone connector module:
asadmin> get server1.connector-module.connector_rar_name.location
To set an attribute called location in the standalone connector module:
asadmin> set server1.connector-module.connector_rar_name.location=
"/export/home/as7se/as1/repository/modules/connector_rar_name"http-listener or http-server.http-listener
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.http-listener.http_listener_name.*
or
asadmin> get server1.http-server.http-listener.http_listener_name.*
To get an attribute called factory:
asadmin> get server1.httpl-listener.http_listener_name.address
or
asadmin> get server1.http-server.http-listener.http_listener_name.address
To set an attribute called address to the IP address 0.0.0.0:
asadmin> set server1.http-listener.http_listener_name.address=0.0.0.0
or
asadmin> set server1.http-server.http-listener.http_listener_name.address=0.0.0.0
mime
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.mime.mime_name.*
To get an attribute called file:
asadmin> get server1.mime.mime_name.file
To set an attribute called file to mime.types:
asadmin> set server1.mime.mime_name.file=mime.types
acl
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.acl.acl_name.*
To get an attribute called file:
asadmin> get server1.acl.acl_name.file
To set an attribute called file:
asadmin> set server1.acl.acl_name.file=com/as1.acl
virtual-server
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get instance_name.virtual-server.vserver_id.*
For example:
asadmin> get server1.virtual-server.server1.*
To get an attribute called httpListeners for virtual server server1:
asadmin> get server1.virtual-server.server1.httpListeners
To set an attribute called acceptLanguage to false:
asadmin> set server1.virtual-acceptLanguage=false
auth-db
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-35 Authentication Database Attributes
server.xml Name
asadmin Name
id
id
database
database
basedn
basedn
certmaps
certmaps
To get all the attributes from an instance:
asadmin> get instancename.virtual-server.vserver_id.auth-db.authdb_id.*
For example, for the instance server1, virtual server server1:
asadmin> get server1.virtual-server.server1.auth-db.authdb_id.*
To get an attribute called database:
asadmin> get server1.virtual-server.server1.auth-db.authdb_id.database
To set an attribute called database:
asadmin> set server1.virtual-server.server1.auth-db.authdb_id.database=Oracle
authrealm
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-36 Authorization Realm Attributes
server.xml Name
asadmin Name
name
name
classname
classname
To get all the attributes from an instance (server1):
asadmin> get server1.authrealm.authrealm_id.*
To get an attribute called classname:
asadmin> get server1.authrealm.authrealm_id.classname
To set an attribute called classname:
asadmin> set server1.authrealm.authrealm_id.classname=com.sun.as.security.auth.real m.sharedpassword.SharedPasswordRealm
lifecycle-module
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.lifecycle-module.lifecycle_module_id.*
To get an attribute called className for a lifecycle module:
asadmin> get server1.lifecycle-module.lifecycle_module_id.className
To set an attribute called className:
asadmin> set server1.lifecycle-module.lifecycle_module_id.className=com.lifecycle_module_id. lifecycle
profiler
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
Table A-38 JVM Profiler Configuration Attributes
server.xml Name
asadmin Name
name
name
classpath
classPath
native-library-path
nativeLibraryPath
enabled
enabled
To get all the attributes from an instance (server1):
asadmin> get server1.profiler.*
To get an attribute called enabled:
asadmin> get server1.profiler.enabled
To set an attribute called enabled to false
asadmin> set server1.profiler.enabled=false
server configuration (name of server instance)
The following table shows the server.xml name for the attribute in the left column, and the name used by asadmin in the right column.
To get all the attributes from an instance (server1):
asadmin> get server1.*
To get an attribute called logRoot:
asadmin> get server1.logRoot
To set an attribute called logRoot:
asadmin> set server1.logRoot="/space/log"
Long and Short Option Formats, Default Values, and Environment Variable Equivalents
The following table lists the long and short formats for command line options. If there is no short format listed, a short format of the option is not available.