Introduction

As an alternative to my article on Deploying BIRT on JBoss, this article will cover BIRT and Tomcat.

Background information on BIRT and the usefulness of hosting BIRT reports on a central server is covered in that prior article.

Table of Contents

Tomcat

Installing Tomcat

I’m using a CentOS 5.5 server for this article.

Installation of Tomcat is quite straightforward with yum:

# yum install tomcat5 tomcat5-admin-webapps xml-commons-apis

Configuring Tomcat

Configuring Tomcat is just as simple as its installation. The only item I had to complete was to add an admin user. I did this by editing the file /etc/tomcat5/tomcat-users.xml file and adding the following line:


Note, please pick a better password.

The admin panel of Tomcat can now be accessed via http://192.168.255.2:8080/admin or whatever your server’s IP address or hostname is.

BIRT

Installing Java

I found that the latest version of BIRT would not run without Java 1.6 installed.

I downloaded the Java 1.6 JDK from its homepage. The exact file name was jdk-6u24-linux-i586-rpm.bin.

When the download finishes, run the file as a shell script:

# sh jdk-6u24-linux-i586-rpm.bin

This installs the various Java components as RPM packages.

Next, edit /etc/sysconfig/tomcat5 and change the JAVA_HOME environment variable to /usr/java/jdk1.6.0_24/

Installing the BIRT Viewer

The BIRT Viewer can be downloaded from here as the Runtime package. Once it has downloaded, unzip the package and then copy the WebViewerExample directory to /var/lib/tomcat5/webapps as birt:

# unzip birt-runtime-2_6_2.zip
# cd birt-runtime-2_6_2.zip
# cp -a WebViewerExample /var/lib/tomcat5/webapps/birt

Also make sure that the birt directory has the correct permissions for the user running the Tomcat server — in this case, tomcat:

# chown -R tomcat /var/lib/tomcat5/webapps/birt

Next, restart Tomcat

# /etc/init.d/tomcat5 restart

Finally, make sure BIRT is running by accessing the Tomcat Manager page at http://192.168.255.2:8080/manager/html. If it is, you can access the BIRT Viewer at http://192.168.255.2:8080/birt.

Deploying Reports

Once the BIRT Viewer is working, you can now copy reports to the server anywhere under the /var/lib/tomcat5/webapps/birt directory and view them online through the URL http://192.168.255.2:8080/birt/frameset?__report=whatever.rptdesign. I usually put all reports under the existing /var/lib/tomcat5/webapps/report directory and then access the report through http://192.168.255.2:8080/birt/frameset?__report=report/whatever.rptdesign.

Enabling JDBC Access

If the data of your reports is located in a database, you will need to install the appropriate JDBC driver for BIRT. I’ll use MySQL for this example.

You can get the MySQL JDBC driver from here.

Once the download is finished, copy the mysql-connector-java-3.1.14-bin.jar file to BIRT:

# tar xzvf mysql-connector-java-3.1.14.tar.gz
# cd mysql-connector-java-3.1.14
# cp mysql-connector-java-3.1.14-bin.jar /var/lib/tomcat5/webapps/birt/WEB-INF/platform/plugin/org.eclipse.birt.report.data.oda.jdbc_2.6.2.r262_v20110127/drivers/

Note, depending on the version of BIRT being used, the actual destination directory could be different. I use the following method to find the right destination:

# find /var/lib/tomcat5/webapps/birt -iname \*jdbc\*

Conclusion

This article covered an alternative configuration to the article Deploying BIRT on JBoss by using Tomcat instead of JBoss.


Tags


Comments

Ashwini Verma on April 5th, 2011:

Great article on deploying BIRT on Tomcat. Can you also submit a link to your article on BIRT Exchange devshare (http://www.birt-exchange.org/org/devshare/) so more BIRT developers can benefit from it?

Joe Topjian on April 5th, 2011:

Hi Ashwini,

All of my BIRT articles have been submitted. Here’s the link for this Tomcat article:

http://birt-exchange.org/org/devshare/deploying-birt-reports/1339-deploying-birt-on-tomcat/

Thanks, Joe

Asparagus on July 19th, 2011:

hi joe, i’m a little a bit confused now as i’m a newbie to birt. is it necessary to deploy the birt report into birt iserver? i have trouble to call the report from PHP. TQ.

Joe Topjian on July 19th, 2011:

Hi,

This page (http://eclipse.org/birt/phoenix/deploy/usingPHP.php) describes a few ways of integrating BIRT and PHP.

My personal way of displaying BIRT reports is to host them on a Java server, such as Tomcat or JBoss, then either directly access the report by way of the Java server URL or embed the URL in an iframe.

Asparagus on July 19th, 2011:

right now i’m using Wampserver. is it by any chance wamp apache conflicting with tomcat apache even different port is defined in same server?

one thing is, if i have BIRT all in one installer, should i install too BIRT Viewer. is ‘Birt iserver’ needed (since i cannot afford the license price)?

TQ very much for your help..

mrtinkz on August 27th, 2011:

Hi,

There should not be any conflict between Wampserver & Tomcat if they are running on different ports. You can deploy birt on tomcat, for basic features open source should be enough and its free.

Rituparna on May 27th, 2012:

Very useful article, thanks.

amit on September 5th, 2012:

Hi Joe,

Great information, I had a question about the link you provided for accessing the report.

What I want to do is I want to be able to view the “report” folder and once we click on that folder it shows the list of reports in it and then we can select and run reports.

I am able to run the report if I directly enter the link in URL but if I only add the link up to the ‘report’ folder it tells me ‘the requested resource not available’..

Let me know if this is doable or not. Thanks

Amit

amit on September 5th, 2012:

Hi Joe,

Regarding my previous comment, what my point is we can’t give separate links for each report to end users. That’s why I asked the question in previous comment :) Thanks.

Amit

Guruppa Padsali on December 14th, 2012:

Amit,

Perhaps you could’ve already found a solution for your problem. I would have set up a reports index page to take care of the issue. Not a clean way of doing it, but it works for me.

Guruppa.