Generating a WAR File for your application
- Make sure you have installed the Tersus WAR Creation Tool (which is available as part of the Enterprise edition of Tersus)
- In Tersus Studio, choose Export->Tersus WAR FIle from File menu
- Select the project and click "Finish" (by default, the war file is created in the project folder)
(The following steps were tested with OC4J version 10.1.3.4.0 on Ubuntu Linux)
Installing OC4J
- Download the OC4J zip file from http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html (requires registration)
- Extract the zip file into a new folder ( in this document, we [OC4J] will refer to the folder were OC4J was extracted)
Setting up an HSQLDB data source
(An easy way to test a Tersus application without instaling a heavier database)
- Copy hsqldb.jar from the Tersus to [OC4J]/j2ee/home/applib
- Create a folder [OC4J]/db to hold hsql databases
- Create an hsqldb data source called "jdbc/tersus1" :
- Edit the file [OC4J]/j2ee/home/config/data-sources.xml
- Added the following elements:
<managed-data-source connection-pool-name="tersus1-pool" jndi-name="jdbc/tersus1" name="tersus1-managed-data-source"/>
<connection-pool name="tersus1-pool">
<connection-factory factory-class="org.hsqldb.jdbcDriver" user="sa" password="" url="jdbc:hsqldb:file:[OC4J]/db/tersus1"/>
</connection-pool>
- Start OC4J (these instruction are for Unix/Linux . If you're using Windows and starting OC4J is not straight forward, check the documentation)
cd [OC4J]
export JAVA_HOME=YOUR_JAVA_HOME (e.g. /usr/lib/jvm/java-6-sun)
export ORACLE_HOME=[OC4J]
./bin/oc4j -start
- Type administrator password when prompted (you're required to type a password on the first time you start OC4J)
Deploying your WAR file
- Point your browser to http://localhost:8888/em
- Log in using user "oc4jadmin" and the password you sepcified when first starting
- Go to "Applications" and click "Deploy"
- Select the WAR file and click "Next"
- In the "Application Attributes" screen, choose application name and clieck "Next"
- In the "Deployment Settings" screen, chose the task "Map Environment References"
- Choose a JNDI Location for datasource jdbc/main (jdbc/tersus1 if you used the instructions for creating a datasource above), and click "OK"
- Back in the "Deployment Settings" screen, click "Deploy"
- After deployment, you should be able to view the application in http://localhost:8888/[ApplicationName]