cjreplaceapp (replace application)
- Organization of this page
Format
cjreplaceapp [server-name] [-nameserver provider-URL]
-name application-name -f file-path
[-t timeout-time] [-replaceDD]
Function
This command replaces a J2EE application.
If the replaced J2EE application contains cosminexus.xml, the Application Server-specific definition information before replacing is destroyed, the default values are restored, and then the information is overwritten with the cosminexus.xml definition information. If the replaced J2EE application does not contain cosminexus.xml, the Application Server-specific definition information is inherited from the J2EE application before replacing.
- Important note
-
When using a WAR application, cosminexus.xml is not read again and hence the definition information is not updated by inheriting the settings when importing.
This command can be executed whether the application is running or stopped. If the application is running, the system waits for the method in the application to terminate, stops the application, executes replacement processing, and then starts the application. However, if stop processing has not terminated even after the amount of time specified by the -t option has elapsed, the application is stopped forcibly.
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.
- -name application-name
-
Specifies the name of the application to be replaced.
- -f file-path
-
Specifies the path of the application file that is to be read.
Specify a standard application file (extension .ear), or WAR file (extension .war).
- -t timeout-time
-
Specifies the maximum amount of time (in seconds) from when the command is executed to wait for a response to be returned, as an integer in the range 0 to 2147483647. When 0 is specified for a running application, no response is returned to the client until stop processing is completed.
If this argument is not specified, 60 seconds is assumed.
- -replaceDD
-
Specifies that the definitions of the DD files (application.xml, ejb-jar.xml, ra.xml, and web.xml) of the pre-replacement application are not to be passed on to the post-replacement application.
Input examples
cjreplaceapp MyServer -name App1 -f App1.ear
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
-
This command cannot be used for an application that is in exploded archive format.
-
If you change one of the DD files (application.xml, ejb-jar.xml, and web.xml) from No to Yes or from Yes to No, the J2EE application cannot be substituted.
-
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 sequence of an option name and its corresponding value (for example, you cannot specify file-path -file); also, you cannot specify an option name in conjunction with a non-corresponding value (for example, you cannot specify -nameserver file-path -file 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 the information file of the application execution environment for the Application Server (extension .zip) is specified, an error occurs.
-
If the application name specified in -name is different from the application name specified in the <display-name> tag of the DD file (application.xml) in the application file, an error occurs.
-
An error occurs if any of the following differences is found in the configurations of the J2EE applications before and after replacement:
-
The number of EJB-JAR, resource adapter, or WAR files is different.
-
The name of an EJB-JAR, RAR, or WAR file is different.
-
-replaceDD is specified and the definitions of the DD files (application.xml, ejb-jar.xml, ra.xml, and web.xml) are different.
-
A method definition for the home interface or component interface in an EJB-JAR file is different.
-
In an EJB-JAR file, the home interfaces (local and remote), the component interfaces (local and remote), and the business interfaces (local and remote) have different method definitions.
-
An annotation value that was set is modified.
-
-
If the stop processing of J2EE application does not terminate within the time specified in -t option, the J2EE application is terminated forcibly within the time specified in ejbserver.rmi.request.timeout key of system property file for server management commands.
-
By default, the J2EE application inherits all the existing attribute information. If you want the application to inherit only the runtime attributes#, execute the command with the -replaceDD option specified.
- #
-
In the property file, you can specify DD file (application.xml, ejb-jar.xml, ra.xml, and web.xml) definitions and property file-specific definitions. The property file-specific definitions are called runtime attributes.
-
If the J2EE application after replacement contains cosminexus.xml and uses CMP 2.0, execute this command when the J2EE application is not running. After executing this command, you must execute the cjgencmpsql command before deployment.
-
If the type of a J2EE application specified in the -name option is different from the type of the file specified in the -f option, an error occurs.
-
A Java heap of approximately three times the file size specified in the argument is temporarily used. When the value three times the file size exceeds the estimated value of the Java heap of the J2EE server, you must specify a value of three times the file size, in the size of the Java heap of the J2EE server.