Jasper Server Install in Glassfish

JasperServer, a repository for your Jasper Report template-ing needs.

Recently my colleague approached me to help him setup a reporting server and come out with the report templates for our "project". He did some research and decided to use JasperReport. (Because we have to pay for Crystal Reports haaa.)

So JasperServer was the facto for scheduling of the report. At the same time it can also help consolidate the templates and resources created from IREPORT.

So we downloaded JasperServer. But it was running on Tomcat. The installation instruction only come with Tomcat and JBoss. So well what the heck, I was familar with GlassFish and Java 6 has such good monitoring tools build in, I setup the JasperServer in GlassFish.

It was not hard.
1) Install Glassfish as per their instruction. (Their instructions is as good as it can get so you will not hear it from me)
2) Open up the Install instruction of JasperServer. In it, it will inform on the database setup. In one of the section it will list down the steps to setup mysql server. Follow it. Execute it in MYSQL. You are almost done.
3) Create the connection pool in Glassfish. The account and password are define in the steps you took in step 2. By default you may only connect locally. ie Glassfish and Mysql are on the same server. The database name is jasperserver and username should be jasperdb if you follow the instruction in 2.
4) Next create the JNDI name and tie it to the connection pool. The jndi name to create should be found in the jasperServer.war/WEB-INF/hibernate.properties. The default would be jdbc/jasperserver
5) Deploy the jasperserver.war.
6) Make correction to the hibernate SQL dialect. (This is also found in the install instruction package with Jasperserver) Then depending on which kind of installation your Glassfish is in, either Standalone or Cluster enable, you will also need to change the dialet properties in /domains//applications/j2ee-modules/jasperserver/WEB-INF and /nodeagents///application/j2ee-modules/jasperserver/WEB-INF.

Why 2 place? Well just to be safe. You can just update the domain site and upon restart the configuration should sync over to the instance. I have not figure out which portion of the Glassfish configuration control this sync process at every restart of the application server instance.

So there you have it. JasperServer in Glassfish. Much better than in Tomcat.
For someone who have been meddling with Java and middleware installation long enff, this ain't that difficult.

2 comments:

Jaime Hablutzel said...

I reached Next create the JNDI name and tie it to the connection pool.

and now I´m inside glasfish with:

Resource Type, and FactoryType, what are the correct values for them?

Ah Choo said...

is the default JDBC JNDI NAME jdbc/jasperserver.

You can always customized it in the WEB-INF