In this fourth part of a series covering the management of OC4J and configuring J2EE applications with Oracle 10g Application Server, we take a closer look at at J2EE application deployment files and more. This article is excerpted from chapter eight of the Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill; ISBN: 0072262710).
Now that you have reviewed the OC4J server XML files (which include the server configuration files and the Web site configuration file), let’s turn our attention to J2EE application XML files. There are two basic types of application configuration XML files: J2EE deployment (configuration) files and an OC4J-specific configuration file.
The application configuration XML files are meant for deployment of J2EE applications defined in an Enterprise Application Archive (EAR) file. The applications can include Web application components such as servlets and JSP pages, as well as EJB applications. A J2EE application can contain various types of modules, listed as follows:
Web applications modules (WAR files), which include servlets and JSP pages
EJB applications modules (EJB JAR files), which include Enterprise JavaBeans (EJBs)
Client applications contained in JAR files (JSPs)
Connectors
In order to deploy an application to OC4J, you archive the JAR and WAR files that belong to the enterprise Java application into an EAR file, whose layout follows J2EE specifications.
Applications that include only a Web application are bound to a UR, to make the application accessible to the Web clients. Applications with the EJB application component, however, aren’t bound to a URL. These can be accessed either through Remote Method Invocation (RMI) or locally, through the JVM running on a server.
OracleAS lets you create clusters of OC4J processes. The Oracle Enterprise Manager provides built-in support for managing such OC4J clusters across the enterprise. You must, therefore, rely on the Oracle Enterprise Manager 10g (Grid Control) and not use the admin.jar tool to manage the OC4 instance by itself. For the same reason, you are advised not to edit a single OC4J instance configuration file directly, but rather, use the Application Server Control. Although only the EJB modules and Web modules have been described thus far, there are actually four J2EE application types: EJB, Servlet (Web modules), JSP, and Client. You’ve already seen that J2EE applications have two types of deployment (or configuration) files, namely:
A J2EE deployment descriptor XML file (stored in the $ORACLE_HOME/applications/<app-name> directory)
An OC4J-specific deployment descriptor XML file (stored in the $ORACLE_HOME/application-deployments/<app-name> directory), denoted by the prefix of orion
You thus end up with a total of eight J2EE Deployment XML files for the four types of applications, four of which are the OC4J-specific Orion XML files and the other four, J2EE XML files.
In addition to the eight possible J2EE deployment XML files, you have a set of four common global configuration files for all types of applications. The four global application configuration files are as follows:
application.xml This is the global application configuration file, which contains the common settings for all applications in an OC4J instance.
orion-application.xml This contains OC4J-specific global application information for all applications.
web-application.xml This contains OC4J-specific global Web application configuration information that specifies common settings for all Web modules.
oc4j-connectors.xml This contains information about global connector configuration.
on the job: The J2EE deployment descriptors are a Java standard, and the application developers provide these (probably as generated by their IDE) to the administrator; subsequently, the OC4J Orion files are generated from these by OracleAS when you deploy the application.
To summarize our discussion, you can have the following J2EE application deployment files in an OC4J environment:
Four common Global Configuration Files: application.xml, orion-application.xml, global-web-application.xml, and oc4j-connectors.xml
Two configuration files for each of the four J2EE application types, one a J2EE deployment descriptor and the other an OC4J-specific deployment descriptor. The resulting files are the following:
For EJBs: ejb-jar.xml and orion-ejb-jar.xml
For Web modules: web.xml and orion-web.xml
For client modules: application-client.xml and orion-application-client.xml
For connectors: ra.xml and oc4j-ra.xml
In the following subsections, the main application XML configuration files are discussed briefly.
exam watch: If you don’t create the OC4J-specfic deployment XML files, they will be automatically created when you deploy J2EE applications.