How Do I Deploy BC4J Applications to JBoss 3?

An Oracle JDeveloper How To Document
October 15, 2002

 

Content

 

Introduction

This document describes in detail the requirements and steps to deploy the BC4J runtime components as well as a BC4J Application as a Web Module to JBoss. This document was written for Oracle9i JDeveloper Release 9.0.3 and JBoss 3.0.3 with Tomcat 4.0.5, although other versions of Oracle9i JDeveloper and/or JBoss should have the same behavior.

Note: There are issues with the class loaders used in Tomcat 4.0.3. Make sure that your JBoss version either uses 4.1.x or 4.0.5.

Note: This document is intended for use with Sun's Java2 SDK 1.4.1. If you use J2SDK 1.3.1 you will get an IllegalAccessViolation exception when you use your BC4J application.

 

Deploying the BC4J runtime to JBoss.

To deploy the BC4J runtime to JBoss, the following JAR files need to be copied to the JBOSS_HOME\server\default\lib directory (for example, C:\jboss-3.0.3_tomcat-4.0.5\server\default\lib).

  • %JDEV_HOME%\BC4J\lib\bc4jct.jar
  • %JDEV_HOME%BC4J\lib\bc4jctejb.jar
  • %JDEV_HOME%BC4J\lib\bc4jdomorcl.jar
  • %JDEV_HOME%BC4J\lib\bc4jhtml.jar
  • %JDEV_HOME%BC4J\lib\bc4jimdomains.jar
  • %JDEV_HOME%BC4J\lib\bc4jmt.jar
  • %JDEV_HOME%BC4J\lib\bc4jmtejb.jar
  • %JDEV_HOME%BC4J\lib\bc4juixtags.jar
  • %JDEV_HOME%BC4J\lib\collections.jar
  • %JDEV_HOME%\BC4J\lib\datatags.jar
  • %JDEV_HOME%\jlib\uix2tags.jar
  • %JDEV_HOME%BC4J\redist\cabo.war
  • %JDEV_HOME%\jdbc\lib\classes12.jar
  • %JDEV_HOME%\jdbc\lib\nls_charset12.jar
  • %JDEV_HOME%\jdev\lib\jdev-rt.jar
  • %JDEV_HOME%\jlib\jdev-cm.jar
  • %JDEV_HOME%\jlib\uix2.jar
  • %JDEV_HOME%\jlib\share.jar
  • %JDEV_HOME%\jlib\regexp.jar
  • %JDEV_HOME%\lib\xmlparserv2.jar
  • %JDEV_HOME%\ord\jlib\ordim.jar
  • %JDEV_HOME%\ord\jlib\ordhttp.jar
  • %JDEV_HOME%\sqlj\lib\runtime12.jar
  • %JDEV_HOME%BC4J\lib\bc4j_jclient_common.jar

Here is a Windows script to copy these files: installbc4j903.bat.

Note: %JDEV_HOME% refers to the directory where Oracle9i JDeveloper is installed.

If you will be using BC4J web applications (which we will), the file bc4j.ear must also be deployed. Copy this file from %JDEV_HOME%\bc4j\redist to JBOSS_HOME\server\default\deploy (for example C:\jboss-3.0.3_tomcat-4.0.5\server\default\deploy).

The run.bat script should be modified so that crimson.jar is on the CLASSPATH before the Oracle XML parser which is installed with the BC4J runtime libraries. Here are the modifications:

After the line:

set JBOSS_HOME=%DIRNAME%\..

Add the following two lines:

rem make sure crimson and xalan are on classpath before the Oracle XML parser
set JBOSS_CLASSPATH=%JBOSS_HOME%\lib\crimson.jar;%JBOSS_HOME%\server\default\lib\xalan.jar;%JBOSS_CLASSPATH%

After these files have been copied to the {JBOSS_HOME}\server\default\lib directory, You must restart JBoss.

 

Creating a BC4J Project.

Our BC4J Project will be created on the DEPT table in the SCOTT sample schema which is part of the Oracle database.

Create an Entity Object, with default View Object and default Application Module in the Business Components Package Wizard. Once created, your project should look similar to the following:

 

Starting JBoss

Set the JAVA_HOME environment variable and add the Java2 SDK’s bin directory to your PATH.

Windows Example:

set JAVA_HOME=C:\jdk1.4.1

UNIX Example:

export JAVA_HOME=/usr/java/jdk1.4.1

Then execute the run located in the JBoss/bin directory. (For example, C:\jboss-3.0.3_tomcat-4.0.5\bin).

After JBoss is started, you will see many lines of information printed to the command shell which end in the following:

22:41:34,742 INFO [Server] JBoss (MX MicroKernel) [3.0.3 Date:200209301503] Started in 0m:46s:507ms

 

Once started, you can ensure that JBoss with Tomcat is running by testing the URL http://localhost:8080/jmx-console/index.jsp. Here is the display that you should see.

Note: If you are behind a proxy server, you may need to change localhost to the DNS name for your machine.

 

Creating a BC4J JSP Application.

In order to test our BC4J business components, we will create a JSP application which will use them.

  1. Create a New Empty Project
  2. Using the Business Components JSP Application wizard, create a default JSP Application for the BC4J objects just created.
  3. From the main menu, Choose File > Save All.

 

Deploying the BC4J JSP Application.

When you create a default BC4J JSP Application, a default deployment profile will be created automatically. The name of this profile is ProjectX_jpr_War.deploy. The BC4J Business Components will be included in the EAR file automatically.

Here are the steps to deploy our EAR file:

  1. In the Navigator, right-click ProjectX_jpr_War.deploy (where ProjectX_jpr_War.deploy is the name of the deployment profile in the BC4J JSP Application project), and choose Deploy to EAR file.
  2. On the Message window, under the Deployment tab, a message will state the location of the newly created EAR file. Copy this file to the JBoss\deploy directory.

Here is an example of the text displayed in the Message Log on the Deployment tab:

Wrote EAR file to C:\jdev\jdev\mywork\Workspace1\Project2\src\ProjectX_jpr_War.ear
Elapsed time for deployment:  8 seconds
---- Deployment finished. ---- Oct 8, 2002 2:19:50 PM

You now have a fully functional BC4J JSP Application deployed as a Web Module. You may now invoke the Application with your web browser with the URL http://localhost:8080/<context root>, where <context root> is the J2EE Context Root for your Project containing the BC4J JSP Application ( For example: Workspace1-Project2-context-root )

 

References

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