You are on page 1of 8

Deploying WAR Files to OC4J by Jeff Hunter, Sr.

Database Administrator

Overview The common-line tool admin.jar is used to deploy applications to the OC4J environmnet. Unfortunately the admin.jar utility requires an EAR file as its deployment archive. There is no option for deploying a WAR file directory. To deploy a WAR file using the admin.jar utility, you must package the WAR file within an EAR file and using a manual process. This article describes the process of manually deploying a WAR file to the OC4J environment. For the purpose of this exercise, I will be deploying a war file named "ServletExamplesApp.war". It is a simple web application (archive) that contains two servlets and a single html file (index.html) used to access the servlets. The Web Context Root is named "ServletExamples". You can download a copy of the the example WAR file from this location: "ServletExamplesApp.war". Setting up OC4J The following instructions will allow you to manually deploy a WAR file (ServletExamplesApp.war) to an OC4J instance. For this example, <OC4J_HOME> is the location where OC4J is installed. 1. First, copy the WAR file to <OC4J_HOME>\j2ee\home\applications: copy ServletExamplesApp.war <OC4J_HOME>\j2ee\home\applications 2. Open the application.xml file in the <OC4J_HOME>\j2ee\home\config directory and add the following after the entry "<web-module id="defaultWebApp" path="../../home/default-web-app" />" as follows: 3. ... 4. <web-module id="defaultWebApp" path="../../home/defaultweb-app" /> 5. <web-module id="ServletExamplesApp" path="../../home/applications/ServletExamplesApp.war" / >

... 6. Open the file http-web-site.xml in the <OC4J_HOME>\j2ee\home\config directory and add the following after the entry "<default-web-app application="default" name="defaultWebApp" />" as follows: 7. ... 8. <default-web-app application="default" name="defaultWebApp" /> 9. <web-app application="default" name="ServletExamplesApp" root="/ServletExamples" /> ... 10. You should now be able to navigate to the newly deployed web application using the following URL: http://localhost:8888/ServletExamples R12: OC4J Overview Hi Everyone!! I thought to enter bit more in depth of R12 techstack. I was talking about 10.1.2 AS and 10.1.3 AS oracle homes earlier. I have discussed why there are two Mid-Tier oracle homes in my earlier post 10g AS in R12 ebiz. In this post I will be covering OC4J. OC4J expands to Oracle Containers For Java. Originally based on the IronFlare Orion Application Server, has developed solely under Oracle's control since Oracle Corporation acquired the source.( this is the reason why you see config files are named as orionweb.xml, orion-application.xml etc.,) In laymans terms OC4J can be described as "Oracle's Implementation of J2EE specification set". Sample specification set can be found here. For example you have finance application which got developed using JSP and servlet specifications. You can package them as war/ear files and deploy them in OC4J containers which will run the applications as per the clients' request from web browser. There are lot more done by OC4J but above one was a simple example. It will have xml based config files.(refer OC4J config files section in Unveiled Inst top post.) In R12 we have 3 groups of OC4J's. OC4J replaces Jserv(Java servlet containers) which came with earlier 11i techstack. oacore OC4J - Supports framework based applications

forms OC4J - Supports forms based applications oafm OC4J - expands to Oracle Application Fusion Middleware - for mapviewer, webservices, ascontrol Number of OC4J instances for each group will be determined by corresponding nprocs context variable ( s_oacore_nprocs, s_forms_nprocs/s_frmsrv_nprocs, s_oafm_nprocs). -bash-2.05b$ ./ status You are running version 120.4 Checking status of OPMN managed processes... Processes in Instance: -------------------+--------------------+---------+--------ias-component | process-type | pid | status -------------------+--------------------+---------+--------OC4J | oafm | 27133 | Alive OC4J | forms | 27064 | Alive OC4J | oacore | 26775 | Alive HTTP_Server | HTTP_Server | 26718 | Alive ASG | ASG | N/A | Down exiting with status 0 check the logfile /slot01/appmgr/R12/inst/apps/r12test_ap6155rt/logs/appl/admin/log/adopmn ctl.txt for more information ... -bash-2.05b$ To be more precise, forms.ear application is deployed in forms OC4J to server forms based applications. ( $IAS_ORACLEHOME/j2ee/forms/applications/forms.ear) oafm.ear, mapviewer.ear, ascontrol.ear applications (can be found at $IAS_ORACLE-HOME/j2ee/oafm/applications/) are deployed under oafm OC4J container. But remember, even if one file change in ear file, will leads to creation of new ear file and redeployment, which is time consuming. hence the dummy ear file is used and config files are tweaked to support adpatching in ebiz

R12. OC4J deployment will create specific directory structure and similar config files. I will cover them in detail in forthcoming posts. I hope You understood bit about OC4J. Lot more to come. Stay Tuned for the next update. Leave your comments.!!

Unveiled - R12 $INST_TOP Earlier I have talked about Inst top which got introduced newly in R12 Ebiz Suite. You may would like to review them before you proceed R12 Architecture INST_TOP in R12 Remember there are no or jserv.conf or in R12 (new techstack), Jserv is replaced by Oacore!! This post is going to have configuration files that will fall under INST TOP directory structure. All the configuration Files are placed under $ORA_CONFIG_HOME If you go inside this directory you will see 10.1.2 and 10.1.3 10.1.2 configuration files will be residing in 10.1.2. for e.g $FORMS_WEB_CONFIG_FILE is placed under $ORA_CONFIG_HOME/10.1.2 - in my instance it is in /slot/ems1636/appmgr/inst/apps/tkr12r3d_rws60029rems/ora/10.1.2/forms/s erver/appsweb.cfg 10.1.3 configuration files will be placed under $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf/ in my instance httpd.conf is located at $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf/ in my instance it is at /slot/ems1636/appmgr/inst/apps/tkr12r3d_rws60029rems/ora/10.1.3/Apache/ Apache/conf

so, good bye to $IAS_ORACLE_HOME/Apache/Apache/conf !!! you will using always $ORA_CONFIG_HOME/10.1.3 to modify Apache configurations in R12. You will be comfortable going forward!! Same location you will see (all apache related configurations files) 10.1.3 configuration files: --------------------------Env file: --------$ORA_CONFIG_HOME/10.1.3/$CONTEXT_NAME.env OH config files: Location: $ORA_CONFIG_HOME/10.1.3/config --------------These files are security related/iAS related parameters. Mostly no modifications required manually. OID/SSO registrations scripts modifies directly. I Planned to write separate post for covering these configuration files as each is big ocean by itself. 1. 2. 3. 4. 5. iasschema.xml jazn-data.xml jazn.xml

Apache Related Configuration Files: $IAS_ORACLE_HOME/Apache/Apache/conf --------------------------------------------------------------------------------------1. apps.conf 2. custom.conf 3. dms.conf 4. httpd.conf 5. mod_oc4j.conf - newly introduced for OC4J conf 6. mod_osso.conf - replaced mod sso conf 7. oracle_apache.conf 8. osso 9. restricted_mode_apache.conf 10. security.conf

11. 12. 13. 14.

ssl.conf ssl_terminator.conf trusted.conf url_fw.conf

OPMN config file: -----------------$ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml

Used by Oracle Process Manager and Notification Server (OPMN) Contains details of all the OC4J instances deployed on the server Location of the log files for OPMN Various ports used by OPMN

$ORA_CONFIG_HOME/10.1.3/network/tnsnames.ora - Apache connection config file OC4J configuration files: ------------------------There are three OC4J deployments in 10.1.3 oracle Homes they are oacore oc4j, forms oc4j, oafm oc4j. All oc4j's will have similar configuration files. application.xml default-web-site.xml global-web-application.xml j2ee-logging.xml jazn.xml jms.xml oc4j-connectors.xml ohwconfig.xml rmi.xml server.xml system-application.xml system-jazn-data.xml Above configuration files are generic OC4J instances. I will be covering them in detail with example how to migrate the deployments you have made in jserv to oacore. As of now just know which replaces what

Its replaced by orion-web.conf (it defines servlet alias, init param serttings etc.). Its under $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/applicationdeployments/oacore/html JavaCache config file: ---------------------$ORA_CONFIG_HOME/10.1.3/javacache/admin/javacache.xml 10.1.2 OH related config Files: ------------------------------Env file: -------$ORA_CONFIG_HOME/10.1.2/$CONTEXT_NAME.env Form Server Configuration Files: --------------------------------

Location: $ORA_CONFIG_HOME/10.1.2/forms/server default.env (replacement of formservlet.ini in 11i) socket.env appsweb.cfg ($FORMS60_WEB_CONFIG_FILE is replaced with $FORMS_WEB_CONFIG_FILE)

Report Builder config file: ------------------------$ORA_CONFIG_HOME/10.1.2/reports/conf/rwbuilder.conf 10.1.2 Listener config files: --------------------------$ORA_CONFIG_HOME/10.1.2/network/admin I believe you got some gist of configuration file system changes in R12. You may ask why this big change?? I have already explained in the post "INST_TOP in R12". In 11..5.10 CU2 if you have implemented shared appltier file system, you will be knowing you how configuration files are generated for each MT nodes. (s_iASconfig_home controls the configuration location location of iAS Top). Stay tuned for more update!! Happy Learning!!