Jasper is one of the standard report generator in the industry. However, setting up Jasper is a pain of ass. This post is my note for setting up Jasper on Linux, in case I have to do it again in the future…
Setting up an Ubuntu instance on Amazon
The first thing you need to do when you launch an Amazon EC2 instance is add the hostname to hosts. Copy
/etc/hosts like so:
ip-10-0-0-1 is the host name in your
/etc/hostname. You’ll need this setup else the jasper installation script might fail.
Update aptitude and install PostgresQL
This section is referenced from Ubuntu PostgreSQL HowTo
After Postgres is installed, you’ll need to setup its permission and password, so that jasper can connect to it.
First, enable postgres to be reached from localhost. Edit
/etc/postgresql/9.1/main/postgresql.conf and un-comment this line:
Then, login to postgres using postgres user:
You should be able to login without using password. Now, update your password:
After setting the password, edit the file
/etc/postgresql/9.1/main/pg_hba.conf and set the
postgres user to use md5 authentication.
Finally, restart the postgres server:
Download and run jasperserver install script
Got to Jaspersoft Downloads and get the
jasperreports-server-cp-5.5.0-linux-x64-installer.run script. In our case we run it as super user.
You’ll go through several steps:
It prints out the license. Read through it and select
ywhen the prompt
Do you accept this license? [y/n]: yshows up.
It asks you to choose complete install or custom install. Choose custom.
It asks you to select a folder for install destination. I chose the default
It asks you to use bundled tomcat or existing one. Choose bundled.
It asks you to use bundled postgres or existing one. Choose existing.
It asks you the Tomcat server port. Just use the default
It asks you postgres binary location. Use
It asks you host and port for postgres server. Use the default
It asks you the postgres password. Type it in.
It asks you whether to install sample database and sample reports. Pick whatever you like.
Proceed the rest of the installation.
Once you’re done with the installation. You can start the tomcat server using the command
Setup plsql query adapter
This section is referenced to Jaspersoft wiki. We found that when selecting query language as
plsql, jasperserver rejects the uploaded report.
To solve the issue, you’ll need to extend jasperserver with this plugin: jasperreports-extensions-3.5.3.jar. Download the jar, and place it to
Now, cd to
/opt/jasperreports-server-cp-5.5.0/apache-tomcat/webapps/jasperserver/WEB-INF, and add one line to
flows/queryBeans.xml. Change the line
<property name="queryLanguages" ref="queryLanguages"> to
1 2 3 4 5 6 7
applicationContext.xml. Search for
supportedQueryLanguages and change it to the following.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Finally, restart the jasper server.
Increase Jasper memory usage
More specifically, tomcat’s memory usage. The default memory setting is quite low and jasper is pretty in-responsive to user clicks. To change the setting, edit
/opt/jasperreports-server-cp-5.5.0/apache-tomcat/scripts/ctl.sh and change the two
Relaunch your jasper server again. Now it should run more smoothly.
ITS A PAIN TO RUN JASPER…
Thanks to all the people that wrote wiki and articles to help me out. I hope I’ll never need to set it up again.