Installing the Oracle9i XML Customer Management Application(CMA)

Table of Contents

Required Software

Back To Top
  • Oracle9i Database version 9.2 or above downloadable from OTN.
  • OC4J (Oracle9iAS containers for J2EE) Release 9.0.3 Production downloadable from OTN.
  • JDK(Java Developer's Kit) version 1.3 or higher downloadable from http://java.sun.com (or) Oracle9i JDeveloper version 9.0.3 downloadable from OTN .
  • Oracle XDK(XML Developer's Kit) for java downloadable from OTN.
  • ANT tool for building the Enterprise ARchive (EAR) file which can be downloaded from Jakarta Apache
  • Any JavaScript and XML enabled browser.

    Note:
    => This sample has been certified with Red Hat Linux Advanced Server 2.1, Solaris 5.6 and Windows NT 4.0, Windows 2000.
    => Best viewed with browsers Netscape Navigator 6 or above, Microsoft Internet Explorer 5 or above. On Linux, best viewed with the Mozilla 1.3 or above browser.

Notations Used

Back To Top

This section will describe the terms used in the document.
For example,

Notation Description
JAVA_HOME Folder where JDK1.3 or above is installed. For example, C:\jdk13 or /home/jdk13
XDK_HOME Folder where you have extracted Oracle9i XDK for Java utility . For example, C:\xdk or /home/xdk
OC4J_HOME Folder where OC4J is installed. For example, C:\oc4j or /home/oc4j
SAMPLE_HOME Folder where the Customer Management sample will be extracted. For example, C:\CustomerManagement or /home/CustomerManagement
ANT_HOME Folder where ANT is installed. For example, C:\ant or /home/ant
   

Extracting the source code

Back To Top

The application files are stored in an archive named CustomerManagement.jar. Download the archive and extract it to a convenient directory. Execute following command to extract  the files:

     jar xvf CustomerManagement.jar

The archive CustomerManagement.jar extracts the files that implement the CMA System. All the files are extracted in the “CustomerManagement” directory. The directory where the sources are extracted will be referred as SAMPLE_HOME.

Deploying the sample application in OC4J

Back To Top

Simple Deployment

Note: You can compile the source code with either JDK 1.3 or Oracle9i JDeveloper.

    Compiling the sources with Oracle9i JDeveloper

    1. In Oracle9i JDeveloper, open the cma.jws workspace that is extracted into the CustomerManagement directory which got created while extracting the jar.
    2. Expand cma.jws node by clicking it. Expand cma.jpr node by clicking it. Now all java files should be visible.
    3. Right click cma.jpr and select 'Project Settings' from pop up menu.
    4. Expand "Common" node. Click on Input Paths. Edit java source path and type full path of 'java' directory inside the 'CustomerManagement' directory where we extracted the sample.
    5. Expand Configurations => Development node from left hand panel. Then Click on Libraries node.
    6. In the available libraries box in the right hand panel click on 'Oracle XML parser v2' and click on single right handed arrow in the middle. This will add the library in current project.
    7. Similarly, select Servlet Runtime library and add them to current project.
    8. Click on New button in this dialog box. New library dialog pops up.
    9. Enter library name as ·mycma· and click on Edit button for CLASSPATH entry.
    10. In the Edit Class Path window  click Add Entry button
    11. Select xdb.jar from XDK_HOME\lib.
    12. Similarly, select xschema.jar from the XDK_HOME\lib directory.
    13. Similarly, select classes12dms.jar from OC4J_HOME\jdbc\lib directory.
    14. Click OK on the create new library windows and return to the Project Settings dialog main window. Here, in the available libraries box in the right hand panel click on 'mycma' and click on single right handed arrow in the middle. This will add the library in current project. Then, click OK on the Project Settings dialog and quit to the Navigator.
    15. Select Customer.java  by clicking on the filename in System Navigator panel
    16. Right click on this file and select Rebuild Customer.java. This should successfully compile this file.
    17. Similarly, compile remaining files .
    18. Oracle9i JDeveloper creates the classes in the 'CustomerManagement\java' directory where we can find compiled class files. SchemaUtil.class will be present under CustomerManagement\java directory.

    Compiling the Java Sources with JDK 1.3

    Note: This application has been certified for Korn Shell in Solaris and Linux. All the instructions for Solaris and Linux pertains to the Korn shell in it. You can enter into Korn Shell in Solaris and Linux by typing "ksh" on the command prompt.

    Following steps need to be followed if we are compiling the java sources using jdk.

    1.      Go to the SAMPLE_HOME/java directory where we have extracted the java sources.

    2.      This contains a bunch of java files.

    3.      Set the JAVA_HOME  environment variable.

         Eg. For Windows   -  set JAVA_HOME=<JAVA_HOME>
         Eg. For Solaris and Linux       -  export JAVA_HOME=/usr/java1.3

    4.      Set the PATH environment variable

         Eg. For Windows   -  set PATH=%JAVA_HOME%\bin;
         Eg. For Solaris and Linux      export PATH=$JAVA_HOME/bin;

    Set the CLASSPATH environment variable. ( As per step No 5 below)

    5.      Make sure that classpath visits following jars. These files are part of XDK for Java, and OC4J installations downloaded earlier in required software.

    XDK_HOME\lib\xmlparserv2.jar
    XDK_HOME\lib\xschema.jar
    XDK_HOME\lib\xdb.jar
    OC4J_HOME\jdbc\lib\classes12dms.jar
    OC4J_HOME\j2ee\home\oc4j.jar
    OC4J_HOME\j2ee\home\lib\servlet.jar

    Eg. For Windows-
    set CLASSPATH=%CLASSPATH%;%XDK_HOME%\lib\xmlparserv2.jar;%XDK_HOME%\lib\xschema.jar;%XDK_HOME%\lib\xdb.jar;
    %OC4J_HOME%\jdbc\lib\classes12dms.jar;%OC4J_HOME%\j2ee\home\oc4j.jar;%OC4J_HOME%\j2ee\home\lib\servlet.jar

    Eg. For Solaris and Linux -
    export CLASSPATH=$CLASSPATH:$XDK_HOME/lib/xmlparserv2.jar:$XDK_HOME/lib/xschema.jar:
    $XDK_HOME/lib/xdb.jar:$OC4J_HOME/jdbc/lib/classes12dms.jar:
    $OC4J_HOME/j2ee/home/oc4j.jar:$OC4J_HOME/j2ee/home/lib/Servlet.jar

    6.      Compile the java sources using the command 

                    javac *.java

    7.      This should successfully compile the sources.

    Copying and Running the application in OC4J

    1. Create a directory called as ·CustomerManagement· under OC4J_HOME\j2ee\home\default-web-app\examples\jsp directory of your OC4J installation.
    2. Move 'jsps', 'images' and 'xml' directories in the SAMPLE_HOME directory to this directory.
    3. Create a directory structure "oracle\otnsamples\cma" under OC4J_HOME\j2ee\home\default-web-app\WEB-INF\classes directory of your OC4J installation.
    4. Copy all compiled classes in SAMPLE_HOME\java directory except SchemaUtil.class to the directory created in the previous Step 3. Instructions for compiling sources are given above.
    5. Re-Start the OC4J Server.
    6. Load the SchemaUtil.class in the database using the steps in Loading Class and Configuring the Application.
    7. Then, point your browser to the URL below to access the main page of the application :

      http://HOSTNAME:PORTNO/examples/jsp/CustomerManagement/jsps/Welcome.jsp

      In the URL,
      Replace HOSTNAME with the name of the host where OC4J is running.
      Replace PORTNO with the port no where OC4J is listening. Default port is 8888.
      Eg. http://incq226b.idc.oracle.com:8888/examples/jsp/CustomerManagement/jsps/Welcome.jsp

Note: After successful installation, please click here to use the functionality of the application.

EAR(Enterprise ARchive) Deployment

Back To Top

Note:
=> Ensure that you have downloaded and installed “ANT” tool (refer required software).
=> Ensure that you have JDK 1.3 or higher installed as it is required for compilation of the .java sources which builds the EAR file
=> ANT_HOME\bin is in the PATH.

1. ANT tool compiles java files automatically. We must set appropriate environment variables so that compilation is successful.
2. Copy the xdb.jar from XDK_HOME\lib directory to OC4J_HOME\j2ee\home\lib directory.
3. Follow steps 3 , 4, 5 of  ·Compiling the java sources using jdk1.3· to set the classpath.
4. Go to ·SAMPLE_HOME· directory and type ant. ANT tool generates CustomerMangement.ear file and places it under ·build· directory.
5. Move this file under  OC4J_HOME\j2ee\home\applications directory.
6. Go to OC4J_HOME\j2ee\home\config directory
7. Edit http-web-site.xml file.
8. Add following entry under <web-site ···.> tag
<web-app application="CustomerManagement" name="CustomerManagement"   root="/CustomerManagement"/>
9. Save this file
10. Open server.xml file from the OC4J_HOME\j2ee\home\config directory and add the following entry within the <application-server> tag.
<application name="CustomerManagement" path="../applications/CustomerManagement.ear" />
11. Save this file and then, restart OC4J server.
12. Load the SchemaUtil.class in the database using the steps in Loading Class and Configuring the Application.
13. Then, point your browser to the URL below to access the main page of the application :

http://HOSTNAME:PORTNO/CustomerManagement/jsps/Welcome.jsp

In the URL,
Replace HOSTNAME with the name of the host where OC4J is running.
Replace PORTNO with the port no where OC4J is listening.
Eg. http://incq226b.idc.oracle.com:8888/CustomerManagement/jsps/Welcome.jsp

Note: After successful installation, please click here to use the functionality of the application.


 
   
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy