cjaddapp (add resource)
- Organization of this page
Format
- For an EJB-JAR, WAR, or RAR file
cjaddapp [server-name] [-nameserver provider-URL] -type {ejb|war|rar} -name J2EE-application-name -resname display-name [-resname display-name ...]- For a filter
cjaddapp [server-name] [-nameserver provider-URL] -type filter -name J2EE-application-name -warname WAR-file-display-name -c Property-file-path [-c Property-file-path ...]
Function
- For an EJB-JAR, WAR, or RAR file
-
If there is a J2EE application, this command adds an imported EJB-JAR, WAR, or RAR file to the J2EE application. This command can add multiple files at once, in which case the files are processed in the sequence in which they are specified.
If there is no J2EE application, this command creates a new J2EE application and then adds an imported EJB-JAR, WAR, or RAR file to the J2EE application.
- For a filter
-
If there is a J2EE application with a WAR file, this command adds a filter to the specified WAR file. The HITACHI Filter Property File specified with the -c option specifies the filter to be added. This command can add multiple filters at once, in which case the filters are processed in the sequence in which they are specified.
If there is no J2EE application or there is no WAR file, an error occurs.
Arguments
- server-name
-
Specifies the name of a connected J2EE server. If the server name is omitted, the host name is assumed.
- -nameserver provider-URL
-
Specifies the access protocol for the CORBA Naming Service, the name of the host running the CORBA Naming Service, and the port number being used by the host. These items are specified in the following format:
protocol-name: : host-name: port-number
For details on the specification items, see 2.1.2 Provider URL.
- -type {ejb|war|rar|filter}
-
Specifies the type of resource to be added:
-
ejb: EJB-JAR file
-
war: WAR file
-
rar: RAR file
-
filter: Filter
-
- -name J2EE-application-name
-
Specifies the name of the J2EE application. The J2EE application name must be a character string consisting of at least one character.
If you are creating a new J2EE application, you can use alphanumeric characters (0-9, A-Z, or a-z) or the following special characters in the name:
plus (+), hyphen (-), period (.), caret (^), underscore (_)
- -resname display-name
-
Specifies the display name of the EJB-JAR, WAR, or RAR file that is to be added.
- -warname WAR-file-display-name
-
Specifies the display name of the WAR file to which the filter is to be added.
- -c Property-file-path
-
Specifies the input source path of the HITACHI Filter Property File.
Input examples
- EJB-JAR file
cjaddapp MyServer -type ejb -name App1 -resname accountJsp
- WAR file
cjaddapp MyServer -type war -name App1 -resname account-war
- RAR file
cjaddapp MyServer -type rar -name App1 -resname account-rar
- Filter
cjaddapp MyServer -type filter -name App1 -warname account-war -c FilterProp.xml
Return values
- 0:
-
The command terminated normally.
- 1:
-
The command terminated abnormally.
- 2:
-
The command could not be executed because of an exclusion error.
- 3:
-
A timeout occurred.
- 9:
-
The command could not be executed because there are no administrator privileges (in Windows).
Notes
-
When you specify a server name in the command arguments, you must specify it immediately after the command name. You can specify the other arguments in any order as long as they are subsequent to the server name (or subsequent to the command name if the server name is omitted). However, you cannot switch the order of an option name and its corresponding value (for example, you cannot specify data-source-display-name -resname); also, you cannot specify an option name in conjunction with a non-corresponding value (for example, you cannot specify -nameserver data-source-display-name -resname provider-URL).
-
When you specify a server name in the command arguments, you must specify a case-sensitive character string that matches a server name specified in a cjsetup (set up or unsetup J2EE server).
-
If multiple files are to be added concurrently, this command attempts to add all files even if there are files that cannot be added. If even one file cannot be added, the termination code becomes 1 (abnormal termination).
-
An EJB-JAR file with the same display name as a previously added EJB-JAR file cannot be added to the same application.
-
A WAR file with the same display name as a previously added WAR file cannot be added to the same application.
-
A filter with the same display name as the previously added filters and servlets to WAR file cannot be added to the same WAR file.
-
A RAR file with the display name same as the previously added RAR file cannot be added to the same application.
-
A RAR file having a native library cannot be added to the application.
-
A RAR file with the display name same as the previously deployed RAR file as a J2EE resource adapter cannot be added to the application.
-
In the filter property file specified by the -c option, the <filter-name> and <filter-class> tags must be specified.
-
The EJB-JAR, WAR, or RAR files cannot be added to applications with the exploded archive format.
-
EJB-JAR files having extension other than ".jar", WAR files having extension other than ".war", and RAR files having extension other than ".rar" cannot be added to the application that does not contain application.xml.
-
A filter cannot be added to WAR files that do not contain web.xml.
-
If the specified application name has more than 255 characters, an error occurs.
-
You cannot add resources (EJB-JAR, WAR, Filter, or RAR) for WAR applications. When you specify a WAR application in the -name option, this command terminates abnormally.