In this third part of a series that focuses on managing OC4J and configuring J2EE applications, we look at how to configure the OC4HJ server. It is excerpted from chapter eight of the Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill; ISBN: 0072262710).
You specify the deployed J2EE applications in the server.xml file by using the <application> element.
Structure of the server.xml File
The server.xml file consists of several elements, each of which is responsible for a certain area of OC4J-related configuration. Hereís a typical server.xml file:
<?xml version="1.0" standalone='yes'?> <!DOCTYPE application-server PUBLIC "Orion Application Server Config" "http://xmlns.oracle.com/ias/dtds/application-server-9_04.dtd"> <application-server application-directory="../applications" deployment-directory="../application-deployments" connector-directory="../connectors" > <rmi-config path="./rmi.xml" /> <!--Interoperability config link--> <sep-config path="./internal-settings.xml" /> <!--JMS-server config link, uncomment to activate the JMS service--> <jms-config path="./jms.xml" /> <javacache-config path="../../../javacache/admin/javacache.xml" /> <j2ee-logging-config path="./j2ee-logging.xml" /> <log> <file path="../log/server.log" /> <!--Uncomment this if you want to use ODL logging capabilities <odl path="../log/server/" max-file-size="1000" max-directory-size= "10000"/> --> </log> <global-application name="default" path="application.xml" /> <global-web-app-config path="global-web-application.xml" /> <!--<web-site path="./secure-web-site.xml" />--> <web-site default="true" path="./default-web-site.xml" /> <!--Add the http-web-site in this way and uncomment this line <web-site path="./http-web-site.xml" /> </application-server>
Note that all the directories referred to inside the server.xml file are relative to the $ORACLE_HOME/j2ee/config directory. In the example shown previously, there are several elements such as application-server and the like. Iíll brieﬂy describe the important elements of the server.xml file in the rest of this section. Note that the example file shown in the previous section doesnít happen to contain all of the following elements.
<application-server> You use the top-level element of the server.xml file, called the <application-server> element, to specify the application server configuration information. The <application-server> element has attributes such as the following:
The application-auto-deploy element specifies the directory the OC4J server automatically deploys applications from.
The application-directory element specifies the directory where the OC4J instance will store the application .ear files. If you donít specify any directory values for this element, the .ear files are, by default, stored in the $ORACLE_HOME/j2ee/home/applications directory. The application-directory element specifies that any files placed in the directory you specify for this element should be automatically deployed.
The deployment-directory element specifies the directory where the OC4J instance should store the files it generates for permanent storage. Each of the applications you deploy will have its own deployment-directory element.
<application> The <application> element specifies the name of the application and the path to the application archive (EAR).
<global-application> The <global-application> element specifies the default application for an OC4J server.
<global-web-app-config> The <global-web-app-config>element specifies the location of the web-application.xml file.
<jms-config> and <rmi-config>The <jms-config> and <rmi-config> elements specify the path to the jms.xml and the rmi.xml files, respectively.
<max-http-connections> The <max-http-connections> element specifies the number of maximum concurrent connections that the Web site can accept.
<web-site> The <web-site> element specifies the path to a web-site.xml file thatís used to define a Web site, as shown in the following example: