Hitachi

uCosminexus Application Server Application Setup Guide


8.1.2 Importing the J2EE applications that are in exploded archive format

J2EE applications that are in exploded archive format do not contain a class file and JAR file of each component in the working directory of J2EE server. These applications contain only the DDs and the path information of the exploded archive and are the J2EE applications with EAR files or ZIP files deployed in the exploded archive path. However, the RAR files included in J2EE applications are stored in the archive format.

You can import the J2EE applications that are in exploded archive format by the following two methods:

The following are the procedures to import the applications that are in exploded archive format:

Organization of this subsection

(1) Importing an application directory as an application in exploded archive format

Use the following procedures to register an application directory in the J2EE server:

  1. Create an application directory.

    Create an application directory to create a new J2EE application in exploded archive format. For details on the configuration of an application directory, see 15.4.2 Configuring an application directory in the uCosminexus Application Server Common Container Functionality Guide.

  2. Import the application directory.

    Register the application directory created in step 1 in the J2EE server.

  3. Execute the following command to import an application directory:

(a) Execution format

cjimportapp [server-name] -a  application-directory-path

(b) Execution example

cjimportapp MyServer -a AppDirPath

For details on the cjimportapp command, see cjimportapp (import J2EE application) in the uCosminexus Application Server Command Reference Guide.

(c) Note

  • You cannot execute this command in a remote environment.

  • You cannot use the application directory that specifies the <alt-dd> tag in application.xml, in exploded archive format.

  • The rules to convert the display name and the directory name when the applications to be imported include application.xml are as follows:

    • A value of the <display-name> tag of application.xml is the display name.

    • If the <display-name> tag does not have a value, a string converting the EAR file name specified in the -f option is considered as the display name.

      Note that if the file name contains characters other than general-purpose characters and numbers, the characters are substituted by underscores (_).

      If the characters to be substituted are continuous, the characters are combined into one underscore (_).

    • The name excluding the extension from the path name described in the <module> tag of application.xml will be the same as the EJB-JAR directory name or WAR directory name.

  • The rules to convert the display name and the directory name when the applications to be imported exclude application.xml are as follows:

    • Remove the extension from the file name specified in the -f option, and thereby the changed character string becomes the display name.

      Note that the characters other than one-byte alphanumeric characters (0 to 9, A to Z, and a to z) and underscores (_) are substituted by underscores (_).

    • For a file name that begins with a period (.), the changed character string without the period (.) removed becomes the display name.

    • The EJB-JAR directory name will end with _jar and the WAR directory name will end with _war.

  • You cannot import an application if a J2EE application that uses the same directory as an application directory exists in the J2EE server.

  • When an application directory created by using the -d option and deploying an EAR file or ZIP file matches either of the following conditions, you cannot import the application directory with the -a option and use it as an exploded-archive application directory.

    • EJB-JAR module name does not end with '.jar'.

    • WAR module name does not end with '.war'.

    • The module name that does not contain an extension is the same as any other module name that does not contain an extension.

    • The module name that does not contain an extension is the same as a directory in an EAR file.

  • The DD for various components under the application directory has UTF-8 encoding.

  • If the DD version is old, the version is changed to as follows:

    Table 8‒3: Changing the DD version

    DD

    Version before importing

    Version after importing

    application.xml

    1.2

    1.4

    1.3

    ejb-jar.xml

    1.1

    2.0

    web.xml

    2.2

    2.3

  • When importing an exploded-archive J2EE application, the process searches for the library JAR below the application directories excluding the EJB-JAR and WAR directories. Therefore, when several files exist below the application directories excluding the EJB-JAR and WAR directories, import may take time.

(2) Importing a J2EE application as an application in exploded archive format

Import the EAR file or the EAR file containing the exported runtime information in exploded archive format.

Execute the following command to import an application in exploded archive format:

(a) Execution format

cjimportapp [server-name]-f  file-path -d exploded-archive-path

The contents of an EAR file or ZIP file are deployed in the exploded archive path.

(b) Execution example

cjimportapp MyServer -f App1.zip -d ApplicationDir

For details on the cjimportapp command, see cjimportapp (import J2EE application) in the uCosminexus Application Server Command Reference Guide.

(c) Note

  • The user who starts the J2EE server requires write-permission for the directory specified in the exploded archive path.

  • You cannot use a J2EE application with an <alt-dd> tag specified in application.xml, in exploded archive format.

  • You cannot import an application if a J2EE application that uses the same directory as the exploded archive exists in the J2EE server.

  • The other precautions are the same as when importing J2EE applications that are in the archive format. To import J2EE applications that are in the archive format, see the precautions described in 8.1.1 Importing the J2EE applications that are in archive format.

  • The DD for various components under the application directory has UTF-8 encoding.