Project Wiki
Views

Configuration

From Wiki

Jump to: navigation, search

JasperReports Server Installation for JBoss 4.0.3

(For more recent JBoss versions, please see Chapter 5 or the JasperReports-Server-Install-Guide.pdf)

Changes required

1. Create a new file 'mysql-ds.xml' with configuration for the application JDBC DataSources. This is similar to the META-INF/context.xml in Tomcat 5.5.15 server

  • Similarly we can configure for other databases like DBVendorNameds.xml (For example hsqldb-ds.xml, oracle-ds.xml etc.,)

2. Create a new file jboss-web.xml and add the <resource-ref> elements from web.xml for both datasources.

  • Add a java: before the JNDI name of the Datasource. JBoss requires this ‘java:’ insert unlike tomcat.
  • JBOSS finds JNDI datasource(s) only from this file.

Deployment options

These two options have been tested and work. See the related example files mysql-ds.xml and jboss-web.xml.

Method 1: Exploded WAR

1. Build the JasperReports Server application. Copy the exploded WAR (i.e., jasperserver folder) and paste it under JBOSS_HOME/server/default/deploy. Rename to jasperserver.war.
2. Copy and paste the mysql-ds.xml under JBOSS_HOME/server/default/deploy
3. Copy and paste the jboss-web.xml under the jasperserver.war/WEB-INF folder.
4. Place the appropriate JAR file having the respective database driver file in the JBOSS_HOME/server/default/lib directory.
5. Start the JBOSS server using JBOSS_HOME/bin/run.cmd (run.sh) and access the application as http://localhost:8080/jasperserver

Method 2: Bundled WAR

1. Place the jboss-web.xml under WEB-INF folder of the JasperReports Server source and build the WAR file. Now it is part of the WAR file itself.
2. Place the jasperserver.war under JBOSS_HOME/server/default/deploy
3. Copy and paste the mysql-ds.xml under JBOSS_HOME/server/default/deploy
4. Place the appropriate JAR file having the respective database driver file in the JBOSS_HOME/server/default/lib directory.
5. Start the JBOSS server using JBOSS_HOME/bin/run.cmd (run.sh) and access the application as http://localhost:8080/jasperserver

NOTE: I had an error with log4j when starting up jboss. I fixed it by removing deploy/jasperserver.war/WEB-INF/lib/log4j-1.2.12.jar. It should be okay since log4j is already a part of the jboss installation.