Tutorial : Unmarshaling and Marshaling Data : Setup
Discuss this tutorial. Printable version (PDF).
This is the Contents page. No previous page. Go up a level. Go to next page.

 

 

Setup


Once you install and configure the IPS sample application as described in the steps listed below, you can study the components described in this tutorial without any further setup. No special setup instructions are required for Unmarshaling and Marshaling Data.

Listed below are the steps required to install and configure the IPS sample application. It contains the following sections:

Terminology

Term Definition

<JDEV_HOME>

The directory where Oracle9i JDeveloper is installed.

<SAMPLE_HOME>

The directory where the source files of the sample have been extracted to. For e.g., /home/.../JAXBApp, if the sample was unzipped to /home

<XDK_HOME> The directory where Oracle Oracle XDK 10g utility is installed.For e.g., /home/.../xdk10g
<JDK_HOME> The directory where JDK 1.4 has been installed.For e.g., /home/.../jdk1.4

Extracting the Source Code

Execute the following command to extract the files:

 >jar xvf JAXBApp.jar

It is important to note that you will find the jar executable in JDK_HOME\bin. Ensure JDK_HOME\bin is present in your system path. (JDK_HOME is the root directory of the JDKx.x installation).

All the files are extracted into the JAXBApp directory.

Configuring the Application

  1. Make sure that your JDK and XDK installation is configured correctly. Follow the install guides for the JDK and XDK for this purpose.

  2. Open a command window if you are running on a Windows platform or a shell window if you are on Solaris or Linux system.

  3. Edit your CLASSPATH and add an entry that points to <XDK_HOME>/lib/xmlparserv2.jar file. To do this, use the following commands:

    On Windows:

    d:\....\xdkjaxb>set CLASSPATH=%CLASSPATH%;<XDK_HOME>\lib\xmlparserv2.jar

    On Linux / Solaris (Note that the syntax provided here is for the bash shell)

    $CLASSPATH=$CLASSPATH:<XDK_HOME>/lib/xmlparserv2.jar
    $export CLASSPATH

  4. Change your current working directory to <SAMPLE_HOME>/xml.

  5. On the command / shell prompt execute following command:

    $java oracle.xml.jaxb.orajaxb -schema profile.xsd -targetPkg oracle.otnsamples.orajaxb -outputDir ../src

  6. This will generate Java support classes that are used later while compiling this application.

Building and Running the Application using Oracle 9i JDeveloper

This section will describe the steps that are required to run the sample using standalone OC4J:

  1. In Oracle9i JDeveloper, open the orajaxb.jws workspace that is extracted into the SAMPLE_HOME directory.

  2. Expand the orajaxb.jws node by clicking it. On clicking the orajaxb.jpr will be visible. Expand orajaxb.jpr node by clicking it. Now all the java sources should be visible.

  3. Right click orajaxb.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 “src” directory under SAMPLE_HOME.

  5. Expand Configurations => Development node from left hand panel. Click on Paths node. Edit Output Directory and type full path of <SAMPLE_HOME>/classes directory under SAMPLE_HOME. This directory does not exist in the shipped jar and will be created at compile time.

  6. Then Click on Libraries node.

  7. You can view the J2SE Version that is supported with your JDeveloper in the right-hand panel . Note: For this application J2SE version 1.4 or later is required. Hence you need to define a J2SE 1.4 for this project. For doing so, please use the following steps:

    i. Click on the Define button. The New J2SE dialog window pops up.

    ii. Enter "J2SE Name " as JDK1.4 and then click on the Browse button for J2SE Executable entry.

    iii. Select java executable from the JDK_HOME\bin

    iv. Click OK on the New J2SE Window and return to the Project settings main window.

    v. From the "Available Libraries" box in the right-hand panel select the JDeveloper Runtime and click on single right-handed arrow in the middle. This will add the library in the current project. Similarly, select Oralce JDBC library and add it to current project.

  8. From selected libraries pane select xmlparserv2 library. Click on Edit button.

    i. Edit library dialog pops up.

    ii. Click on Edit button for CLASSPATH entry.

    iii. Edit Class Path dialog pops up. Remove existing entry and add new entry that points to xmlparserv2.jar from XDK_HOME\lib. Press OK button to dismiss the box.

    iv. Click OK button to dismiss all open windows.

  9. Return to the System Navigator pane on the left hand side.

  10. Click on the Green + sign in the left hand corner. This will pop up Add Files or Directories dialog box.

  11. Go to <SAMPLE_HOME>/src/oracle/otnsamples/orajaxb/profile directory.

  12. Select all java files and jaxb.properties file and add these files to orajaxb.jpr project.

  13. To complile the java sources, right click on orajaxb.jpr and select "Rebuild orajaxb.jpr" option. This should successfully compile all the java sources. Oracle9i JDeveloper creates the classes inside <SAMPLE_HOME>/classes directory with the relevant package structure.

  14. Select MainFrame.java by clicking on the filename in System Navigator panel. For running the application, right click MainFrame.java and select "Run MainFrame.java" option.

    For more details on how to use the application, please refer to the Readme file that comes with the JAXBApp.jar.


Discuss this tutorial. Printable version (PDF).
This is the Contents page. No previous page. Go up a level. Go to next page.
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