Jason Bennett's Developer Corner

 






Click to see the XML version of this web page.

>


View David Jason Bennett's profile on LinkedIn

 

 

A Little About Jason Bennett ...

I've had an interest in publishing technical articles and HELPFUL code for a few years.  I am (by trade and hobby) a developer who specializes in Oracle technologies and web based architectures.  I have been an employee of both TUSC and Oracle Corporation.  My intent here is to share my ideas and coding experiences with the developer community as a whole.  As with all developers some of my ideas are great and some of them are ....  well you know.  Anyway, I hope you find something here that will aid in your endeavor, or spark a new idea. 

I am more than happy to assist with technical issues and will even write a little code if need be. If you find something on the site that is really useful and you'd like to make a contribution (absolutely up to you and absolutely not required), just click the "Make a Donation" button on the left!

Good luck and good coding !




  Sunday, August 05, 2007


OC4J Instance Startup Dependencies

   OracleAS 10g can be configured to allow startup dependencies between OC4J instances.  In other words, OC4J instance OC4J_B cannot start until OC4J instance OC4J_A has started.  This is along the same lines as one MS Windows service being dependant on another at startup.    This is useful (and necessary) if OC4J instance OC4J_A contains services that provide some sort of critical data that some application in OC4J instance OC4J_B needs as part of its initialization.  The only catch to this is that the OC4J instances can't be located within the same ias-component.  An ias-component consists of one or more process-types.  An example of a process-type would be an OC4J instance.  For example, every time you create a new OC4J instance using dcmctl or OracleAS 10g Enterprise Manager, it is placed under the ias-component called "OC4J".  Other examples of common ias-components are: LogLoader, dcm-daemon,  HTTP_Server,  and WebCache.  Executing the command "opmnctl status" will give a listing of each ias-component and the name of each process-type associated with it.  

The easiest way to create a new ias-component and associated OC4J instance (or process-type) with a dependency on another OC4J instance is:

1. Create a new OC4J instance (process-type) using dcmctl or OracleAS Enterprise Manager (skip this step if you plan on moving an existing OC4J instance).
2. Open the opmn.xml file and create a new ias-component entry (make sure you back-up the existing file and shutdown opmn before doing this …)

           <ias-component id="My Custom Component">
           ...
           </ias-component>

3. Locate the OC4J instance you created in step-one (it should be under the "OC4J" ias-component).  Cut the entire tag set defining the OC4J instance (process-type) and paste it into your new ias-component (You can also do this with an existing OC4J instance):

           <ias-component id=" My Custom Component ">
            <process-type id="OC4J_B" module-id="OC4J">
               <module-data>
                  <category id="start-parameters">
                     <data id="java-options" value="-server -Djava.security.policy= /app/oracle/product/10.1.2/midtier/j2ee/ OC4J_B /config/java2.policy -Djava.awt.headless=true"/>
                     <data id="oc4j-options" value="-properties"/>
                  </category>
                  <category id="stop-parameters">
                     <data id="java-options" value="-Djava.security.policy= /app/oracle/product/10.1.2/midtier/j2ee/ OC4J_B /config/java2.policy -Djava.awt.headless=true"/>
                  </category>
               </module-data>
               <start timeout="900" retry="2"/>
               <stop timeout="120"/>
               <restart timeout="720" retry="2"/>
               <port id="ajp" range="12501-12600"/>
               <port id="rmi" range="12401-12500"/>
               <port id="jms" range="12601-12700"/>
               <process-set id="default_island" numprocs="1"/>
            </process-type>
         </ias-component>

4.  To define the dependency between the OC4J instance defined under your new ias-component and another OC4J instance defined under a different ias-component, you need to add a dependency definition under the ias-component tag:

           <ias-component id=" My Custom Component ">
               <dependencies>
                  <managed-process ias-component="OC4J" process-type="OC4J_A" process-set="default_island" autostart="true" />
               </dependencies>

            <process-type id="OC4J_B" module-id="OC4J">
               <module-data>
                  <category id="start-parameters">
                     <data id="java-options" value="-server -Djava.security.policy= /app/oracle/product/10.1.2/midtier/j2ee/ OC4J_B /config/java2.policy -Djava.awt.headless=true"/>
                     <data id="oc4j-options" value="-properties"/>
                  </category>
                  <category id="stop-parameters">
                     <data id="java-options" value="-Djava.security.policy= /app/oracle/product/10.1.2/midtier/j2ee/ OC4J_B /config/java2.policy -Djava.awt.headless=true"/>
                  </category>
               </module-data>
               <start timeout="900" retry="2"/>
               <stop timeout="120"/>
               <restart timeout="720" retry="2"/>
               <port id="ajp" range="12501-12600"/>
               <port id="rmi" range="12401-12500"/>
               <port id="jms" range="12601-12700"/>
               <process-set id="default_island" numprocs="1"/>
            </process-type>
         </ias-component>

5. Save the opmn.xml file and start up opmn and all of its processes.


That's all there is to it!  Now OC4J_B will not start until OC4J_A has started.


6:10:29 PM    

Click here to visit the Radio UserLand website. © Copyright 2008Jason Bennett.
Last update: 8/28/2008; 9:46:39 PM.

August 2007
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Jul   Nov