Integrating by building a JReport Server EAR

The self-contained JReport Server can be deployed as a single EAR file. After specifying the reporthome and configuring the database information, you can build the EAR file using the tool makewar.bat/makewar.sh in <install_root>\bin. To generate the EAR file, execute the command with the buildEar parameter, for example:

makewar.bat/makewar.sh buildEar

Structure of the JReport Server EAR

For example, here you can create a JReport Server EAR file named jreport.ear. The structure of the JReport Server EAR is as follows:

jreport.ear

META-INF/application.xml

Following the Java EE standard, you should configure the META-INF/application.xml file before deploying the EAR:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" 
"http://java.sun.com/dtd/application_1_3.dtd">

<application>
    <display-name>Self-contained JReport Server</display-name>
    <module id="JReportWebModule">
        <web>
            <web-uri>jreport.war</web-uri>
            <context-root>jreport</context-root>
        </web>
    </module>
</application>
META-INF/MANIFEST.MF of Web module

Since the JReport Server library is included in jreport-lib of the EAR layer, you must specify Class-Path in the META-INF/MANIFEST.MF file. The contents below should be included in the MANIFEST.MF file:

Class-Path: jreport-lib/jrenv.jar jreport-lib/JRESServlets.jar jreport-lib/JREngine.jar ...

Class-Path is a list of all packages in the JReport Server library. Each package name should start with the prefix jreport-lib/, and you should use a blank space to separate package names.

WEB-INF/web.xml of Web module

The contents in the web.xml of the JReport Server EAR are the same as the contents in web.xml of the JReport Server WAR. See the section Integrating by building a JReport Server WAR for details.