Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Download, install and configure the Oracle OC4J 10.1.3.5 stand alone server

...

Info

Help is available by sending an email to csf-support@mit.edu
Have any suggestion on how improve this wiki?  Please give us your feedback at csf-support@mit.edu

Panel

Quick Links to:

Table of Contents
minLevel4
Panel

Download the OC4J stand alone server

...

  1. Go to the Oracle Internet Application Server site.  Click on the Downloads tab and all available Application Server 10g Release 3 (10.1.3.x) Downloads will be displayed.

  2. Scroll down until you reach the Oracle Containers for J2EE section and click on Pure Java.  The Oracle Application Server 10g Software Downloads will be displayed.

  3. Accept the License Agreement, then click on the Oracle Containers for J2EE 10g (OC4J) link. The download of the oc4j_extended_101350.zip file will start.

...

  1.   Save this zip file on your workstation.

Install

...

Configure

...

  1. NOTE: Before the download begins, Oracle will require you to either log in using an existing Oracle account or you will have to create a new Oracle account.

Install the OC4J stand alone server

indent

In your $\{user.home} directory, create the directories 

Unzip it somewhere

...

oc4j/10.1.3.5.0 and unzip the *oc4j_extended_101350.zip* file to the $\{user.home}/oc4j/10.3.5.0 directory. 

...

Note: It is recommended not to install oc4j in a path which has spaces in it (e.g. C:\Program Files) as such configuration will cause compilation errors when JasperReports attempted to use the oc4j path to compile reports.

         According to the findings of one of our developers, JasperReports will substitue the space between the text "Program" and "Files" in the name with "%20" and the compilation will result in error.

Configure

...

 Create a system environmental variable *ORACLE_HOME* and set it's value to $\{user.home}/oc4j/10.3.5.0.
\\
\\
For example: if *$\{user.home}=/users/rstone*, then *ORACLE_HOME=/user/rstone/oc4j/10.1.3.5.0*
\\
\\
You can actually unzip to any directory you desire.  The only requirement is that all directory names cannot contain any white space.
\\
\\
*For MAC users*:  You can now [download a nice plugin | Install the Oracle OC4J 10.1.3

...

.5 standalone server^RCEnvironment-1.4.X.dmg] that helps you manage your system environmental variables.  The plugin, *RCEnvironment*, is a preference pane for MacOS X 10.1 or higher that allows editing of your ~/.MacOSX/environment.plist file.

Configure the OC4J stand alone server

indent
Info

The above change is made to prevent PermGEN errors for occurring.  If you get PermGen Out of Memory errors when either deploying your application or when starting the oracle server, increase the 512M values to 1024M.

  1. Edit the file ${ORACLE_HOME}/j2ee/home/config/system-application.xml

...

  1. and change:
    Code Block
    
    <import-shared-library name="oracle.toplink">
    
    to:
    Code Block
    
    <!--import-shared-library name="oracle.toplink"-->
    

to get Hibernate to work correctly.  Something to to with antlr packages conflicting with OC4J's.

  1. If you want to disable the Oracle Enterprise Manager then change
    Code Block
    
    <import-shared-library name="oracle.xml"/>
    
    to:
    Code Block
    
    <!--import-shared-library name="oracle.xml"/ -->
    
    When you are satisfied that everything is correct, SAVE your changes.
  2. We need to add a datasource so that the applications can pull data from the database.  Edit ${ORACLE_HOME/j2ee/home/config/data-sources.xml to add a datasource.  Here's an example of adding a MITSIS datasource:
    Code Block
    
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS2"
        location="jdbc/MitsisDS"
        xa-location="jdbc/xa/StargateXADS-unused"
        ejb-location="jdbc/OracleDS-unused"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username=""
        password=""
        url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev11"
        inactivity-timeout="30"
    />
    
    where obviously you MUST add your username and password.  If you do not have a username and password, request a them from your team leader.
    When you are satisfied that everything is correct, SAVE your changes.
  3. FOR WINDOWS ONLY - setting the administrator's password

    Open a CMD window and cd to the ${ORACLE_HOME}/bin directory. Type the following command:
    Code Block
    
    oc4j -start
    
    You will be asked to enter and confirm a password.  Pick a password that is easy for you to remember.  You will need to use this password when configuring Maven.

    Anchor
    parser configuration
    parser configuration

...

  1. In order to use Spring 3.

...

  1. X with OC4J 10.1.3, you'll need to swap out the default XML parser in OC4J with something more modern.

...

  1.   xercesImpl.jar and xml-apis.jar work fine.

...

  1.   To swap the parser out, you need to create a new shared library in the OC4J enterprise manager and then edit the system-application.xml file to use your new shared library instead of the Oracle XML parser.

    Start and stop the OC4J server.

    Open

...

  1. ${ORACLE_HOME}/j2ee/home/application-deployments/default/orion-application.xml

...

  1. with a text editor.

...

  1.   If the file or any sub-directory does not exist,

...

  1. create them as needed.

    If you had to create the file

...

  1. a new, these are the contents of the file:
    Code Block
    
    <?xml version='1.0' encoding='utf-8'?>
    <orion-application
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd"
        schema-major-version="10"
        schema-minor-version="0"
        component-classification="internal">
        <imported-shared-libraries>
            <remove-inherited name="oracle.xml"/>
        </imported-shared-libraries>
    </orion-application>
    
    If you had an existing file, add this block to it:
    Code Block
    
    <imported-shared-libraries>
        <remove-inherited name="oracle.xml"/>
    </imported-shared-libraries>
    

...

  1. When you are satisfied that everything is correct, SAVE your changes.
  2. FOR ALL OPERATING SYSTEMS - how to change the administrator password.

    Open ${ORACLE_HOME}/j2ee/home/config/system-jazn-data.xml with a text editor.

    Find the <user> tag block for oc4jadmin.  Change the oc4jadmin's <credentials> property to (substituting your password for myNewPassowd):
    Code Block
    
    <credentials>!myNewPassword</credentials>
    
    Be sure to preface the password with an ! to inidcate that this is a plain text value.

    When completed, the oc4jadmin <user> should look something like:
    Code Block
    
    <user>
        <name>oc4jadmin</name>
        <display-name>OC4J Administrator</display-name>
        <guid>E33D5A508AA511DF8F573778FB23EDF8</guid>
        <description>OC4J Administrator</description>
        <credentials>!myNewPassword</credentials>
    </user>
    
    Save the changes and restart the OC4J server.

Getting Better Debugging

...

Information From OC4J

Panel

By default, some run time errors that you'll see when testing web apps in OC4J are not too helpful.

...

  You can coax OC4J into giving you more information about certain errors by

...

making the following changes in global-web-application.xml:

...


Open ${ORACLE_HOME}/j2ee/home/config/global-web-application.xml with a text editor.

  1. Turn on "development" mode - in the <orion-web-app> section at the top of the file, change the "development" setting to true:
    Code Block
    
    <orion-web-app
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"
      jsp-cache-directory="./persistence"
      servlet-webdir="/servlet"
      development="true"
      jsp-timeout="0"
      jsp-cache-tlds="standard"
      schema-major-version="10"
      schema-minor-version="0">
    

...

  1. Turn on debug mode. In the "jsp" servlet section, set a parameter debug_mode to true. The section should look like this:
    Code Block
    
    <servlet>
          <servlet-name>jsp</servlet-name>
          <servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
          <init-param>
            <param-name>debug_mode</param-name>
            <param-value>true</param-value>
  1. 
          </init-param>
          <load-on-startup>0</load-on-startup>
    </servlet>
    
    With these settings, you should get more meaningful messages in your browser when you run into certain errors (JSP syntax errors for example).

    Add a Datasource

    Wiki Markup
    We need to add a datasource to our applications can pull data from the database.&nbsp; Edit \[j2ee.home\]/config/data-sources.xml to add a datasource.&nbsp; Here's an example of adding a MITSIS datasource:

    Code Block
    
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS2"
        location="jdbc/MitsisDS"
        xa-location="jdbc/xa/StargateXADS-unused"
        ejb-location="jdbc/OracleDS-unused"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username=""
        password=""
        url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev2"
        inactivity-timeout="30"
    />
    

    ...

    1. indent