Integrating remote JReport Enterprise Server with WebLogic 7.0 by a WAR file

Here is an example illustrating the case of using JSPs based on remote server APIs to integrate with WebLogic 7.0.

It is assumed that:

Take the following steps to integrate remote JReport Enterprise Server with WebLogic 7.0:

  1. Generate a WAR file.
  2. Configure JReport Enterprise Server.
  3. Deploy the WAR file.

Below show the details of each step:

Generating a WAR file

  1. Create a new directory in your local disk, e.g. C:\jsp.
  2. Create a sub directory WEB-INF in it: C:\jsp\WEB-INF.
  3. Generate a web.xml file like following and put it in C:\jsp\WEB-INF.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>


    <context-param> <param-name>jrs.remote.host</param-name> <param-value>127.0.0.1</param-value> </context-param>


    <context-param> <param-name>jrs.remote.rmiport</param-name> <param-value>1129</param-value> </context-param>


    <!-- The third param(jrs.rmi.auth_file) is optional. "authFileName" includes the auth file's realpath and auth filename. For example: C:\JReport\Server\bin\rmi.auth. The content of the auth file specified here should be kept consistent with that of the auth file used by JReport Enterprise Server, though there is no need to point to the same auth file.-->


    <context-param> <param-name>jrs.rmi.auth_file</param-name> <param-value>C:\JReport\Server\bin\rmi.auth</param-value> </context-param>


    <filter> <filter-name>Character Encoding</filter-name> <filter-class>jet.server.servlets.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter>


    <filter-mapping> <filter-name>Character Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>


    <servlet> <servlet-name>sendfile</servlet-name> <servlet-class>jet.server.servlets.SendFileServlet</servlet-class> </servlet>


    <servlet> <servlet-name>dhtml</servlet-name> <servlet-class>jet.web.dhtml.DHTMLlet</servlet-class> </servlet>


    <servlet> <servlet-name>jrdhtml</servlet-name> <servlet-class>jet.web.dhtml.DHTMLRunReportlet</servlet-class> </servlet>


    <servlet> <servlet-name>help</servlet-name> <servlet-class>jet.web.dhtml.JHelplet</servlet-class> </servlet>


    <servlet-mapping> <servlet-name>sendfile</servlet-name> <url-pattern>/sendfile/*</url-pattern> </servlet-mapping>


    <servlet-mapping> <servlet-name>dhtml</servlet-name> <url-pattern>/dhtml/*</url-pattern> </servlet-mapping>


    <servlet-mapping> <servlet-name>jrdhtml</servlet-name> <url-pattern>/jrdhtml/*</url-pattern> </servlet-mapping>


    <servlet-mapping> <servlet-name>help</servlet-name> <url-pattern>/help/*</url-pattern> </servlet-mapping>


    </web-app>

  4. Create a directory lib in C:\jsp\WEB-INF.
  5. Copy the class files JREngine.jar, JRESServlets.jar, JRWebDesign.jar, log4j-1.2.8.jar and sac.jar from C:\JReport\Server\lib to C:\jsp\WEB-INF\lib.
  6. Create a jar file to include the resources folder which is located in server installation root and name it languages.jar. For example, run the following command:

    C:\JReport\Server>jar -cvf languages.jar resources

    Then put the jar in C:\jsp\WEB-INF\lib.

  7. Copy all the folders in C:\JReport\Server\public_html to C:\jsp. If you are not using remote administration functions you can remove the admin directory.
  8. Optionally copy the folder help in C:\JReport\Server to C:\jsp. Remove all the directories except for help\server\en\userguide. If you copy the help folders then you can remove the JHelplet servlet from the web.xml file. The help documents will be served locally rather than go through the remote JHelplet servlet.
  9. Use the following command to create a WAR file, and name it as jsp.war:

    C:\jsp>jar -cvf jsp.war *

Configuring JReport Enterprise Server

  1. Make sure JReport Enterprise Server has been started once in order that the server.properties file is generated.
  2. Change server.properties file in <server_install_root>\bin as follows:

    server.rmiserver.enable=true
    server.rmiadminservice.enable=true

    Note: You only need to turn on server.rmiadminservice if you include the admin JSP pages from public_html.

Deploying the WAR file

  1. Start WebLogic 7.0.
  2. Open the Administrative Console.

    You can open the Administrative Console by using URL http://hostname:7001/console/, where the hostname is host name or IP address, and 7001 is the port number.

  3. After your successful login, in the Domain Configurations panel, click Web Applications node, and then click Configure a new Web Application.
  4. Click Upload it through your browser, select your .war file by clicking the Browse button, and then click Upload.
  5. Click Select before jsp.war, choose the Target Server, and then click Configure and Deploy.
  6. Click Deploy All, to make the status of Deployed to be true.
  7. Start JReport Enterprise Server and access it using the following URL:

    http://localhost:7001/jsp/jinfonet/index.jsp