Hitachi

Hitachi Application Server V10 Command Reference Guide (For UNIX® Systems)


2.12.1 add-library

Adds one or more library JAR files to Java EE Server.

Synopsis

asadmin [asadmin-options] add-library [--help]
    [--type={common|ext|app}] [--upload={false|true}]
    library-file-path [library-file-path ... ]

Storage location

Application Server installation directory/javaee/glassfish/bin

Function

The add-library subcommand adds one or more library archive files to Java EE Server.

This subcommand is supported in remote mode only.

The DAS or server instance has to be restarted so that the libraries are picked up by the server runtime.

Precondition

DAS has to be in a running state.

Files

The library .jar files that need to be added to the DAS or server instance are entered as inputs for the add-library subcommand execution.

Arguments

--help | -?

Displays the help text for the subcommand.

--type={common|ext|app}

Specifies the library type and Application Server directory to which the library is added.

Type: String

The following values can be specified:

  • common

    Adds the library files to the Common class loader directory: domain-dir/lib. This is the default value.

  • ext

    Adds the library files to the Java optional package directory: domain-dir/lib/ext.

  • app

    Adds the library files to the application-specific class loader directory: domain-dir/lib/applibs.

Default value: common

--upload={false|true}

Specifies whether the subcommand uploads the file to the DAS. In most situations, this option can be omitted. The valid values are as follows: true and false.

The default value depends on whether the DAS is on the host where the subcommand is run or is on a remote host.

If the DAS is on the host where the subcommand is run, then the default value is false.

If the DAS is on a remote host, then the default value is true.

In this situation, the subcommand fails if the --upload option is false.

If a directory file path is specified, this option is ignored.

Type: Boolean

The following values can be specified:

  • true

    The subcommand uploads the file to the DAS over a network connection.

  • false

    The subcommand does not upload the file and attempts to access the file through a specified file name. If the DAS cannot access the file, the subcommand fails.

    For example, the DAS may be running as a different user than the administration user and does not have read access to the file.

Default value:

If the DAS is on the host where the subcommand is run, then the default value is false.

If the DAS is on a remote host, then the default value is true.

library-file-path

Specifies the path to archive files that contain the libraries that have to be added. The relative path is the Application Server installation directory/javaee/glassfish/bin directory.

Type: String

The following values can be specified:

  • Multiple paths separated by a space

  • Absolute or relative path

Default value: N/A

Examples

The following example adds the library available in the archive file mylib.jar, to the application-specific class loader directory on the default server instance.

asadmin add-library --type app /tmp/mylib.jar

Exit Status

Exit Status

Explanation

0

command executed successfully.

1

error in executing the command.