Configuration

Within OC4J there are two sets of configuration files: those for the OC4J container and server itself and those for the application.

OC4J Server Configuration Files

Configuration files for the OC4J container are located in $ORACLE_HOME/j2ee/home/config , as you can see here:

 $ ls $ORACLE_HOME/j2ee/home/config application.xml             java2.policy   oc4j-connectors.xml database-schemas            javacache.xml  oc4j.properties data-sources.xml            jazn-data.xml  principals.xml global-web-application.xml  jazn.xml       rmi.xml http-web-site.xml           jms.xml        server.xml internal-settings.xml       mime.types $ 

These files are updated with application information during deployment, but they aren't dedicated to a specific application. An OC4J server can have multiple, distinct applications deployed to it. The listing of each application at the server level takes place in these files as well as in the configuration settings for the OC4J server itself.

While each of these files is important, two files that are key to the deployed applications are server.xml and http-web-site.xml .

The server.xml file lists the locations of key application, application-deployment , and connector directories. It also identifies other key configuration files such as rmi.xml, jms.xml, application.xml, global-web-application.xml , and http-web-site.xml . Additionally, it lists the location of the server.log .

The following is an example of the server.xml file:

 <?xml version="1.0"?> <!DOCTYPE application-server PUBLIC "-//Oracle//DTD OC4J Application-server 9.04//EN" "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" />         <jms-config path="./jms.xml" />         <log>                 <file path="../log/server.log" />         </log>         <transaction-config timeout="30000" />         <java-compiler name="javac" in-process="false" encoding="ISO8859_1" extdirs="/u01/app/oracle/product/9.0.4mt1/OraHome1/jdk/jre/lib/ext" />         <global-application name="default" path="application.xml" />         <application name="petstore" path="../applications/petstore.ear" auto-start="true" />         <global-web-app-config path="global-web-application.xml" />         <web-site path="./http-web-site.xml" />         <cluster id="88665489450944" /> </application-server> 

Of key importance for the discussion of application deployments is the reference to the Petstore application. This is a demo application that you'll learn how to deploy later in this chapter. Notice that the Petstore application has been already deployed and is now listed in the application tag with a path to the ../applications/petstore.ear file. The auto-start flag is also set to true . This indicates the application has been deployed to this OC4J server.

The next key file for deployed applications is the http-web-site. xml file, as shown in the following sample.

 <?xml version="1.0"?> <!DOCTYPE web-site PUBLIC "-//Oracle//DTD OC4J Web-site 9.04//EN"   "http://xmlns.oracle.com/ias/dtds/web-site-9_04.dtd"> <web-site port="11999" display-name="Oracle9iAS Containers for J2EE HTTP Web Site">         <default-web-app application="default" name="defaultWebApp" />         <web-app application="default" name="dms0" root="/dms0" />         <web-app application="default" name="dms" root="/dmsoc4j" />         <web-app application="default" name="admin_web" root="/adminoc4j" />         <web-app application="petstore" name="petstore" load-on-startup="true"   root="/petstore" />         <access-log path="../log/http-web-access.log" /> </web-site> 

This file identifies the URI where the deployed application can be reached. Specifically, it lists the root location for the application on the URL. In this case it's http://hostname.doman/petstore , as shown here:

 <web-app application="petstore" name="petstore" load-on-startup="true" root="/petstore" /> 

The file also lists the application name and the load-on-startup parameters.

Greater details on the files in the $ORACLE_HOME/j2ee/home/config directory are covered in previous chapters, which focus on server configuration.

Application Configuration Files

The primary focus of this chapter is the application files. Later in the chapter we'll explain how applications are stored in application archive files (JAR, EAR, and WAR), however, within those packaged files are individual configuration files. These configuration files are deployment descriptors for the application. They specify the deployment and runtime behavior of the application code. There are two subclassifications of these deployment descriptors: those that are standard in any J2EE application server and those that are specific to OC4J.

Configuration files with specific OC4J parameters are prefaced with "orion" to denote the Orion web server, which is the source of OC4J (for example, orion-web .xml ). These are written to the $ORACLE_HOME/j2ee/home/application-deployments subdirectories after the application has been deployed to the server.

Note 

Just as Oracle Corporation licensed the Apache web server as the basis for its OHS, so they also did a similar move for the J2EE server. OC4J is based on a licensed copy of the Orion application server by IronFlare. Documentation specific to Orion can be found at www.ironflare.com .

The application deployment descriptors that are most commonly configured are web.xml, application.xml, orion-web.xml , and orion-application.xml .

We provide examples of these files later in the chapter specific to their location within EAR and WAR files. However, to find detailed information about the options available within any deployment descriptor, there's a URL at the top of each file. For example, at the top of the web.xml file the URL http://java.sun.com/j2ee/dtds/web-app_2.2.dtd is provided. Or for orion-application.xml there's http://xmlns.oracle.com/ias/dtds/orion-application.dtd . Another excellent source of documentation is the documentation section for the Orion server, which you can find at www.ironflare.com/docs/ .



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net