Deploying to JBoss 3.0.7

Take the following steps to deploy JReport Engine Bean as an EJB to JBoss 3.0.7:

  1. Preparation
  2. Building and deploying the JReport demo program
  3. Running the client application
  4. Managing the entity beans
Preparation

Assume that:

In order to simplify your work, you are provided with a zip called ant_jreport_ejb.zip, which can be found in <designer_install_root>\help\designer\samples. You can extract it to D:\jboss-3.0.7_jakarta-tomcat-4.1.24 directory. This zip file contains a build utility Ant and the JReport EJB demo source code.

Building and deploying the JReport demo program

Follow the steps below to build and deploy the demo program:

  1. Copy JREngine.jar in C:\JReport\Designer\lib to D:\jboss-3.0.7_jakarta-tomcat-4.1.24\client.
  2. In the Command Prompt window, switch to the D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb folder that was created by the extraction process.
  3. Set the JAVA_HOME and JBOSS_HOME environment variables to point to where your JDK and JBoss 3.0.7 have been installed:
    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb>
    set JAVA_HOME=C:\j2sdk1.4.1_01
    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb>
    set JBOSS_HOME=D:\jboss-3.0.7_jakarta-tomcat-4.1.24 
    
  4. Add Ant to your execution path.

    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb> set PATH=..\ant\bin;%PATH%

  5. Change the path and key information in JREngineClient.java according to your own environment in the file ant_jreport_ejb.zip.
  6. Issue the command Ant and press the Enter key as follows:

    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb>ant

    A screen message will then be shown as below:

    Buildfile: build.xml
    prepare:
    compile:
    [javac] Compiling 1 source file to 
    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb\build\classes
    ejbjar:
    [jar] Building jar: 
    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb\build\sdk_egbn_ejb_jrengine.jar
    [copy] Copying 1 file to D:\jboss-3.0.7_jakarta-tomcat-4.1.24\server\default\deploy
    BUILD SUCCESSFUL
    Total time: 3 seconds
    

The ejb_jrengine.jar has now been successfully built and deployed to D:\jboss-3.0.7_jakarta-tomcat-4.1.24\server\default\deploy.

Running the client application

Perform the following tasks:

  1. Open a Command Prompt window, and change to the D:\jboss-3.0.7_jakarta-tomcat-4.1.24\bin folder.
  2. Invoke the JBoss Server using run.bat, located in <JBossServer_install_root>\bin folder.

    Note: Before you run the batch file, be sure to add the bold part of the following to the class path:

    set JBOSS_CLASSPATH= C:\JReport\Designer\lib\JREngine.jar;C:\JReport\Designer\lib\sac.jar;C:\JReport\Designer\lib\log4j-1.2.8.jar;C:\JReport\Designer\lib\Itext.zip; %JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR%

  3. In another Command Prompt window, run the JREngineClient application by invoking ant run.client_jreport. Remember to set your JBOSS_HOME and PATH environment variables.

    D:\jboss-3.0.7_jakarta-tomcat-4.1.24\workbook\jreport_ejb>ant run.client_jreport

    The output of JREngineClient will look something like this:

    Buildfile: build.xml
    prepare:
    compile:
    ejbjar:
    run.client_jreport:
    [java] ReportHome: true
    [java] ReportName: true
    [java] CatName: true
    [java] RstName: true
    [java] getStatus = OK
    [java] exportToPdf OK
    [java] Exit
    BUILD SUCCESSFUL
    Total time: 15 seconds
    

    Three files: CustomerList.pdf, CustomerList.rst and JReport.log, specified in JREngineClient.java, will be generated in C:\JReport\Designer\temp.

Note: You will need a User ID and a JReport Runtime Key to run the JReport client application. If you do not have this, contact Jinfonet Software sales at sales@jinfonet.com or visit Jinfonet website http://www.jinfonet.com for more information.

Managing the entity beans

Every EJB in JBoss is deployed and managed as a JMX MBean. You can view and manage EJBs deployed within JBoss through your web browser by accessing the JMX management console. The console is available at http://localhost:8080/jmx-console/index.jsp.