11.4.4 Rules for determining the modules when application.xml does not exist
(1) For the archive-format applications or the exploded archive-format applications imported by specifying the -d option
If an application not containing application.xml is imported in the archive format or is imported in the exploded archive format (specifying -d option in the cjimportapp command), the module is determined according to the Java EE specifications. The order in which the modules are determined is as follows:
- All the files with the extension .war are considered as the Web modules.
- All the files with the extension .rar are considered as the resource adapters.
- The lib directory is considered as the library directory.
- Except the files under the lib directory, the files with extension .jar are determined as follows:
- The JAR files containing META-INF/ejb-jar.xml file or the EJB component annotations are considered as the EJB modules.
- The JAR files directly beneath the J2EE application root, except hitachi-runtime.jar, are considered as the library JAR.
All the files that do not satisfy these rules are ignored.
- Hint
- Context root of a Web module
- The context root of the Web module is the string excluding the extension .war from the relative path from the application package root to the WAR file.
- Therefore, when application.xml is omitted, specify the directory name of the WAR file path and the WAR file name using characters available in URI (RFC3986).
- The following figure shows the Web module configuration and context root example.
Figure 11-10 Web module configuration and context root example (For the archive-format applications or for the exploded archive-format applications imported by specifying the -d option)
![[Figure]](figure/zu071000.gif)
- Note that depending on the WAR file path, the context root might be duplicated for multiple WAR files. For example, if a WAR file named 'sub/.war' and a WAR file named 'sub.war' exist, the context root for both becomes 'sub'.
(2) For the exploded archive-format applications imported by specifying the -a option
If an application not containing application.xml is imported in the exploded archive format (specifying -a option in the cjimportapp command), the WAR directory, EJB-JAR directory, and modules are determined sequentially according to the following rules. The order of determining the modules is as follows:
- If a directory ending with _war exists in the layer below the root of the application directory, that directory is considered as the WAR directory. However, if the following conditions are fulfilled, the directory is not considered as the WAR directory:
- Directories under the WAR directory
- Directories under the EJB-JAR directory
- lib directory
- If a directory ending with _jar exists in the layer below the root of the application directory, that directory is considered as the EJB-JAR directory. However, if the following conditions are fulfilled, the directory is not considered as the EJB-JAR directory:
- Directories under the WAR directory
- Directories under the EJB-JAR directory
- lib directory and the directories under the lib directory
- Except the files under the WAR directory and the EJB-JAR directory, all the files with extension .rar are considered as the resource adapters.
- The lib directory is considered as the library directory.
- Except the files under the WAR directory, EJB-JAR directory, and the lib directory, for the files with extension .jar, the JAR files directly beneath the J2EE application root, excluding hitachi-runtime.jar, are considered as library JAR.
All the files that do not satisfy these rules are ignored.
- Hint
- Context root of a Web module
- The context root of the Web module is the string excluding the extension _war from behind the relative path from the application directory to the WAR directory.
- Therefore, when application.xml is omitted, specify the directory name of the WAR directory path and the WAR directory name using characters available in URI (RFC3986).
- The following figure shows the Web module configuration and context root example.
Figure 11-11 Web module configuration and context root example (For the exploded archive-format applications imported by specifying the -a option)
![[Figure]](figure/zu071100.gif)
- Note that depending on the WAR directory path, the context root might be duplicated for multiple WAR directories. For example, if a WAR directory named 'sub/_war' and a WAR directory named 'sub_war' exist, the context root for both becomes 'sub'.
(3) Method of handling the library directory in the EAR file or the application directory
This section describes the method of handling the library directory in the EAR file or the application directory when application.xml does not exist. The method of handling the library directory differs when a directory or file named lib exists and when both do not exist in the EAR file or application directory.
Table 11-11 Method of handling the library directory in the EAR file or application directory when application.xml does not exist
lib in the EAR file or lib in the application directory | Handling method |
---|
When the directory exists | lib is handled as the library directory. |
When the file exists | KDJE42360-E is output during import and an error occurs. |
When the directory or file do not exist | Operations are performed assuming the library directory does not exist. (lib existing in other locations is not handled as the library directory). |