#### Deploying to WebLogic 8.1 on Windows/Linux

This demo shows how JReport Engine Bean can be deployed as an EJB to WebLogic Server 8.1 on Linux and Windows. The steps below are based on Linux. For Windows, the procedure is similar to Linux, where you only need to change the path information.

In this demo, an EJB client application is created, which calls an EJB module deployed in WebLogic Server 8.1. In the EJB module, the session bean calls JReport Engine Bean to run and export a report to the PDF format. The image below illustrates the working structure of this demo.

JReport Engine Bean is the module running report templates against a data source and exporting report results to the specified format such as html, pdf, rtf and so on (see Exporting report results to different file formats for methods about exporting report result to other formats).

The steps for this demo are as below:

1. Preparation
2. Wrapping the Engine Bean into a session bean
3. Building the EJB and running the client application

##### Preparation

To prepare for this demo you will need to install the Weblogic Server 8.1 and JReport Designer. Follow the steps below:

1. Install WebLogic Server 8.1 to `/home/bea/weblogic81`.
2. Download Java EE SDK from http://java.sun.com.
3. Assume that you have installed JReport Designer in `/home/jreport/designer`. You will get JReport Engine and related libraries in `/home/jreport/designer/lib`.
   - JREngine.jar - It is required.
   - log4j-1.2.8.jar - Required. It is called by JReport Engine to generate log information at runtime.
   - sac.jar - Required. It is used to parse xml files.
   - hsqldb.jar - Necessary for this demo. This demo runs a report against HSQL database, and hsqldb.jar is the hsqldb driver.
   - Itext.zip - Necessary for this demo. Rename Itext.zip to Itext.jar. It is used to export to PDF.

Note: JReport Engine Bean in JReport Designer is of single thread. That is, you can only have it run one report at a time. To build your production EJB which calls JReport Engine Bean for concurrent multiple reports, contact Jinfonet Support about the JReport Server Engine product.

##### Wrapping the Engine Bean into a session bean

When deploying JReport Engine Bean as an EJB to WebLogic 8.1, JReport Engine Bean should be wrapped into a session bean. For more information, refer to the demo program provided by JReport in ejbweblogic81.zip in `/home/jreport/designer/help/designer/samples`.

##### Building the EJB and running the client application

You can use ant to make an EAR file in WebLogic 8.1. Take the following steps:

1. Create a folder enginebean in `/home/bea/weblogic81/samples/server/examples/src/examples/ejb20/basic`.
2. Copy all the files in the package ejbweblogic81.zip to the folder enginebean.
3. Modify the files in the package ejbweblogic81.zip.

   Change the path and key information in JREngineClient.java according to your own environment, and change the reporthome in the file build.xml to `/home/jreport/designer`.

4. Start the WebLogic example server using the following command:

   `/home/bea/weblogic81/samples/domains/examples/startExamplesServer.sh`

5. Set the environment variables by executing the env.sh file.
6. Build the EAR file and deploy by running the following command:

   `ant`

7. Check whether the above configuration is successful by running the following command:

   `ant run`

8. The BUILD SUCCESSFUL information will be displayed in the console when the configuration is successful.