Tutorial : Unmarshaling and Marshaling Data : Setup
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:
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
Make sure that your JDK and XDK installation
is configured correctly. Follow the install guides for the JDK and XDK for
this purpose.
Open a command window if you are running on a
Windows platform or a shell window if you are on Solaris or Linux system.
Edit your CLASSPATH and add an entry that points
to <XDK_HOME>/lib/xmlparserv2.jar file. To do this, use the following
commands:
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:
In Oracle9i
JDeveloper, open the orajaxb.jws workspace that is extracted into the SAMPLE_HOME
directory.
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.
Right click orajaxb.jpr and select Project
Settings from pop up menu.
Expand "Common" node. Click on Input
Paths. Edit java source path and type full path of src directory
under SAMPLE_HOME.
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.
Then Click on Libraries node.
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.
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.
Return to the System Navigator pane on the left
hand side.
Click on the Green + sign in the left hand corner.
This will pop up Add Files or Directories dialog box.
Go to <SAMPLE_HOME>/src/oracle/otnsamples/orajaxb/profile
directory.
Select all java files and jaxb.properties file
and add these files to orajaxb.jpr project.
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.
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.