HomeOracle Page 3 - Configuring J2EE Application XML Files
The orion-application.xml File - Oracle
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).
The orion-application.xml file is the OC4J-specific global configuration file for all applications in an OC4J instance. You specify the following types of configuration information in the orion-application.xml file:
autocreate-tables and autodelete-tables: You must define a data source for all container-managed persistence (CMP) beans. The autocreate-tables attributes determine whether to automatically create tables for CMP beans for entity bean persistence, thus ensuring that fields and database types are mapped correctly. The autodelete-tables attribute determines whether to automatically delete the tables. By default, autocreate-tables is set to true and autodelete-tables is set to false.
Default data sources for CMP beans
Default security user manager
JNDI authorization
If you want to bind EJBs to existing database tables, set the autocreate-tables attribute to false. You then deploy the EJB in a .ear file. Finally, you reconfigure the newly generated orion-ejb-jar.xml file so it uses the existing database tables.
global-web-application.xml The global-web-application.xml file contains common settings for all the Web modules in an OC4J instance. The file contains OC4J-specific global Web application configuration details.
oc4j-connectors.xml The oc4j-connectors.xml file is a connector configuration file that contains the global OC4J-specific connector configuration information.
Now that you’ve reviewed the four global J2EE configuration files, let’s turn our attention to the two types of configuration files (J2EE-specific files and OC4J-specific files) that each of the four application types (EJB, Web module, client, and connector) can have.
EJB
The EJB-related XML files are J2EE EJB application configuration files, used to define EJB deployment descriptors; they are part of the EJB JAR file. There are two EJB XML files: the J2EE ejb-jar.xml file and the OC4J-specific orion-ejb-jar.xml file.
J2EE ejb-jar.xml The ejb-jar.xml file defines EJB deployment parameters in a JAR file. If you’re using CMP, the file contains definitions for the container-managed EJBs.
OC4J-Specific orion-ejb-jar. The orion-ejb-jar.xml file defines OC4J-specific deployment descriptors for EJBs and thus contains the deployment time information for EJBs. The file provides the mapping for EJBs to the OC4J server environment. You can specify the following attributes in the orion-ejb-jar.xml file:
Session persistence settings
Time-out settings
Transaction retry settings
CMP, ORMI, and JNDI mappings
The orion-ejb-jar.xml file is located in the $ORACLE_HOME/j2ee/home/ application-deployments directory. After you deploy an application, you’ll find the orion-ejb-jar.xml file in the /deploymentName/jarname(.jar)/orion-ejb-jar.xml directory. If you bundle the EJB with the application or if you don’t specify a deployment directory in the OC4J main configuration file (server.xml), the orion-ejb-jar.xml file will be stored under the META-INF/orion-ejb-jar.xml directory.
The orion-ejb-jar.xml file will be copied to the directory specified for the deployment-directory attribute, but only if there are no prior files in that directory. Note that that you use the orion-ejb-jar.xml file only for the initial configuring of an application deployment. After this, the OC4J instance will modify the files to add pertinent information to it.