11.3.6 Operations of the applications containing cosminexus.xml

This subsection describes the operations of the applications containing cosminexus.xml.

Organization of this subsection
(1) Flow of creating a new application containing cosminexus.xml
(2) Importing applications
(3) Starting applications
(4) Procedure of changing the definition information after the application starts
(5) Replacing applications
(6) Exporting applications
(7) Deleting J2EE resources from applications

(1) Flow of creating a new application containing cosminexus.xml

This section describes the flow of operations for creating a new application containing cosminexus.xml.

You create the application containing cosminexus.xml in the development environment. Import the created application into the execution environment and then start the application.

The following figure shows the flow of operations from the creation of the application containing cosminexus.xml in the development environment to the starting of the application in the execution environment.

Figure 11-7 Flow of operations from the creation of the application containing cosminexus.xml to the starting of the application in the execution environment

[Figure]

The following is a description of points 1 through 3 in the figure:

  1. Creating an application containing cosminexus.xml
    Create the class files, default DD, and cosminexus.xml and archive them according to the application format or allocate them in the application directory. For details on creating the class files, DD, and applications containing cosminexus.xml, see the uCosminexus Application Server Application Development Guide. Also, for details on creating cosminexus.xml using a text editor, see 11.3.4 Creating cosminexus.xml.
  2. Importing the application
    You import the application created in the development environment into the execution environment. For details on importing applications, see (2) Importing applications.
  3. Starting the application
    You start the imported application. For details on how to start an application, see (3) Starting applications.

(2) Importing applications

This section describes the importing of applications containing cosminexus.xml.

For the applications containing cosminexus.xml, the cosminexus.xml information is read when the application is imported. To import the J2EE application, execute the cjimportapp command. For details on the cjimportapp command, see cjimportapp (Importing J2EE applications) in the uCosminexus Application Server Command Reference Guide. For the notes on importing the J2EE applications, see 8.1 Importing J2EE applications in the uCosminexus Application Server Application Setup Guide.

Execute the cjimportwar command to import a WAR application. For details on the cjimportwar command, see cjimportwar (Importing WAR applications) in the uCosminexus Application Server Command Reference Guide. For details on the WAR applications, see 13.9 WAR applications.

(3) Starting applications

This section describes the starting of the applications containing cosminexus.xml.

The same procedure is used for starting an application containing cosminexus.xml that is used for starting an application not containing cosminexus.xml. To start the application, you execute the cjstartapp command. For details on the cjstartapp command, see cjstartapp (Starting the J2EE applications) in the uCosminexus Application Server Command Reference Guide. For the notes on starting the J2EE applications, see 10.2.1 Starting the J2EE applications in the uCosminexus Application Server Application Setup Guide.

The following is a description of the operations of an application when an application containing cosminexus.xml is started in the execution environment, stopped once, and then restarted:

The operations will be described separately for the archive-format applications, exploded archive-format applications, and applications not containing cosminexus.xml as the formats when the application is restarted.

(4) Procedure of changing the definition information after the application starts

This section describes the procedures for changing the definition information of the application after the application imported from the development environment is started in the execution environment.

When you change the definitions for the applications containing cosminexus.xml, the procedure differs depending on whether the application format is the archive format or the exploded archive format.

The procedure for changing the contents defined for each application format is as follows:

Reference note
As in the case of the applications not containing cosminexus.xml, you can also use the server management commands (cjgetappprop command and cjsetappprop command) to change the contents defined for an application.
Note
The notes on changing the information defined in the applications containing cosminexus.xml are as follows:
  • If you want to return all the Cosminexus Application Server-specific definition information to the default values, you delete all the elements except the <cosminexus-app> element from the cosminexus.xml file.
  • The following paragraphs describe the notes on changing the application definitions by using the server management commands, for each application format:
For the archive format
When you change the definition information using the redeploy functionality, the application runtime information of Cosminexus Application Server is returned to the default values once, and the information defined in the replaced cosminexus.xml is read. Therefore, all the definition information set up with the server management commands is lost.
Note
For a WAR application, you cannot change the definition information with the redeploy functionality. Use the server management commands (cjgetappprop and cjsetappprop commands) to change the information.
For the exploded archive format
The contents of the application attributes changed by using the server management commands are applied as are to cosminexus.xml in the application directory.
Note that the cosminexus.xml definition information is not read with the reload functionality. If you want to apply the changed definition information, you must restart the application. For details on changing the definition information by using HITACHI Application Integrated Property File and server management commands, see 9. Setting up the J2EE Application Properties in the uCosminexus Application Server Application Setup Guide.
(a) For the archive format

This section describes the procedure of changing the definition information when the application containing cosminexus.xml is an archive-format application. Note that the definition information of the applications containing cosminexus.xml can be changed not only with the procedure described here, but also with the procedure of using the server management commands and property files.

When you want to change the definition content after the application containing cosminexus.xml is started in the execution environment, change the definition content of the application in the development environment. After changing and archiving the definition content in the development environment, import the application into the execution environment again and then replace the application.

You can also export a running J2EE application by setting the application in the ZIP format with runtime information. The procedure of operating applications in the ZIP format with runtime information is the same for the applications containing cosminexus.xml and the applications not containing cosminexus.xml. For details on exporting applications, see (6) Exporting applications.

The following figure shows the procedure of changing the content defined in the applications containing cosminexus.xml.

Figure 11-8 Procedure of changing the content defined in the applications containing cosminexus.xml (In the archive format)

[Figure]

The following subsection describes the points 1 through 4 of the above figure:

  1. Editing cosminexus.xml
    To change the definition information after the application containing cosminexus.xml is imported into the execution environment, you edit cosminexus.xml in the development environment. For details on editing cosminexus.xml, see 5.3.2 How to operate the cosminexus.xml editor in the uCosminexus Application Server Application Development Guide.
  2. Re-archiving the EAR file
    You include the edited cosminexus.xml into the application and archive the file.
  3. Replacing the application
    You replace the application being used in the execution environment with the application that is re-created in the development environment . For details on replacing an application, see (5) Replacing applications.
  4. Starting the application
    You start the application. For details on how to start an application, see (3) Starting applications.
    Hint
    When you use the server management commands to change the cosminexus.xml definition information and when you replace an application, the cosminexus.xml definition information included in the replaced J2EE application is overwritten. To change the cosminexus.xml definition information, you edit cosminexus.xml in the development environment, and then redeploy or re-import the application.
    For details on how to change the definition information by using the server management commands, see 9. Setting up the J2EE Application Properties in the uCosminexus Application Server Application Setup Guide.
(b) For the exploded archive format

This subsection describes the procedure of changing the definition information when the application containing cosminexus.xml is an exploded archive-format application.

The following figure shows the procedure of changing the content defined in the applications containing cosminexus.xml.

Figure 11-9 Procedure of changing the content defined in the applications containing cosminexus.xml (In the exploded archive format)

[Figure]

The following subsection describes the points 1 through 4 of the above figure:

  1. Editing cosminexus.xml
    To change the definition information after the application containing cosminexus.xml is imported into the execution environment, you edit cosminexus.xml in the development environment. For details on editing cosminexus.xml, see 5.3.2 How to operate the cosminexus.xml editor in the uCosminexus Application Server Application Development Guide.
  2. Allocating to the application directory
    You allocate the edited cosminexus.xml to the application directory. For details on allocation to the application directory, see 1.4.1 Exploded archive-format J2EE applications in the uCosminexus Application Server Application Development Guide.
  3. Stopping the application
    You stop the application being used in the execution environment. For details on stopping an application, see 10.2.2 Stopping the J2EE applications in the uCosminexus Application Server Application Setup Guide.
  4. Starting the application
    You start the imported application. For details on starting applications, see (3) Starting applications.

(5) Replacing applications

This subsection describes the replacement of the applications containing cosminexus.xml.

To replace the archive-format applications, you use the redeploy functionality. When you replace an application using the redeploy functionality, the cosminexus.xml information included in the replaced application is read again. You change cosminexus.xml in the development environment, re-archive in the EAR file, and then redeploy to change the Cosminexus Application Server-specific definition information.

Note
For a WAR application, you cannot change the definition information by replacing applications. Use the server management commands (cjgetappprop and cjsetappprop commands) to change the information.

Note that if the application to be replaced does not contain cosminexus.xml, the definition information of cosminexus.xml before replacement is carried over. #

To use the redeploy functionality, you use the cjreplaceapp command. For details on the cjreplaceap command, see cjreplaceapp (Replacing applications) in the uCosminexus Application Server Command Reference Guide. For details on the notes on the redeploy functionality, see 10.5.1 Archive-format applications in the uCosminexus Application Server Application Setup Guide.

#: Regardless of whether cosminexus.xml exists in the application to be replaced, the DD cannot be replaced.

Note
The notes on replacing the archive-format applications are as follows:
  • For the applications containing cosminexus.xml, if you use the server management commands to change the Cosminexus Application Server-specific definition information, and then execute the redeploy functionality, the Cosminexus Application Server-specific information changed with the server management commands is lost.
  • To return all the Cosminexus Application Server-specific information to the default values, delete all the elements except <cosminexus-app> from cosminexus.xml, and then you replace the applications containing cosminexus.xml.

(6) Exporting applications

This subsection describes the exporting of the applications containing cosminexus.xml.

To export an application, you use the cjexportapp command. For details on the cjexportapp command, see cjexportapp (Exporting J2EE applications) in the uCosminexus Application Server Command Reference Guide. For details on the notes on the exporting of applications, see 8.2 Exporting J2EE applications in the uCosminexus Application Server Application Setup Guide.

Note
You cannot export an application for a WAR application.

When the applications containing cosminexus.xml are exported in the archive format, cosminexus.xml is included in the exported EAR file. The following table describes the combination of the applications to be exported and the exported EAR files.

Table 11-4 Combination of the applications to be exported and the exported EAR files

Formats of the applications to be exportedFormats of the exported EAR files
When the -normal option is specified in the cjexportapp commandWhen the -raw option is specified in the cjexportapp command
Applications containing cosminexus.xmlZIP format with runtime information containing cosminexus.xmlEAR file containing cosminexus.xml
Applications not containing cosminexus.xmlZIP format with runtime information not containing cosminexus.xmlEAR file not containing cosminexus.xml
Note
The notes on cosminexus.xml included in the exported applications are as follows:
  • The comments are not stored.
  • The character encoding is UTF-8.
  • If you export a J2EE application containing cosminexus.xml in which the DTD version mentioned in DOCTYPE is an old version, the DTD version is changed to the latest version supported with Application Server.
  • Only cosminexus.xml that was finally successfully read by the J2EE server is included in the exported EAR/ZIP. After the J2EE server reads cosminexus.xml, even if cosminexus.xml in the application directory is changed, the changed definition information is not included in the exported EAR/ZIP. For example, after importing the exploded archive-format application, if cosminexus.xml is re-written in the application directory and the application is exported in the EAR format without being started, cosminexus.xml used for importing is included in the EAR file. cosminexus.xml in the application directory that was updated after being imported is not included.

(7) Deleting J2EE resources from applications

When you delete a J2EE resource from the application, even if cosminexus.xml contains the information of the J2EE resource to be deleted, that information is not deleted.

If cosminexus.xml contains definition information for customizing an element that does not exist in the application, a warning message is issued during the execution of the server management command that reads cosminexus.xml.