Installing JasperServer 3 on JBoss AS 5

JasperServer is a kick-ass reporting application.

Running it under JBoss 5 isn't too hard, but you've got to tweak some stuff to do so (or at least I did).

First off, I like to use an ear, so create the jasperserver.ear folder in your chosen deploy folder (ex. jboss/server/default/deploy/jasperserver.ear)

Next create the META-INF folder (ex. jboss/server/default/deploy/jasperserver.ear/META-INF)

Add this as application.xml (ex. jboss/server/default/deploy/jasperserver.ear/META-INF/application.xml):

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">

<display-name>jasperserver 3</display-name>
<module id="WebModule_1">
<web>
<web-uri>jasperserver.war</web-uri>
<context-root>/jasperserver</context-root>
</web>
</module>
</application>

Now move the jasperserver.war file into your ear directory, and rename it to jasperserver.war.zip, and unzip it. This should leave you with a folder like so (ex. jboss/server/default/deploy/jasperserver.ear/jasperserver.war)

Delete the jasperserver.war.zip file.

Edit the jasperserver.war/WEB-INF/web.xml file, and remove the datasources that you don't need (unless you want to use the sugarCRM stuff or example foodmart stuff)

Remove these:

<resource-ref>
<description>SugarCRM example database</description>
<res-ref-name>jdbc/sugarcrm</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<resource-ref>
<description>Foodmart database</description>
<res-ref-name>jdbc/foodmart</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

delete the jasperserver.war/WEB-INF/application.xml (we're using the one in the ear, and the original throws some weird namespace error for me).

I had to delete xercesImpl-2.6.2.jar from the WEB-INF/lib folder for the GA version of JBoss 5 (didn't get in the way for the RCs, but there you go-- classloading changes, I assume).

Copy the js-mysql-ds.xml file from the {jasperserver-bin.zip}/scripts into your deploy folder (ex. jboss/server/default/deploy/js-mysql-ds.xml)

Remove the foodmart and sugarCRM datasources from that file too.

Copy the mysql-connector.jar (if you don't already have one) from {jaspserserver-bin.zip}/scripts/drivers to your server lib directory (ex. jboss/server/default/lib).

Create or update your jasperserver database (scripts are in the {jasperserver-bin.zip}/scripts directory).

Edit the jboss/server/default/deploy/js-mysql-ds.xml file and set the correct username and password.

Start your jboss server.

Running JasperServer on JBoss 4.0.5GA

Since I once again got JasperServer going on JBoss, I figured I'd document how.

Follow the install instructions for the most part, but you will need to A: create a mysql-ds.xml (for example) something like this (put it in the deploy/ directory):

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server DataBase Configuration -->
<!-- -->
<!-- ===================================================================== -->

<datasources>

<local-tx-datasource>
<jndi-name>jdbc/jasperserver</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jasperserver</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>jasperadmin</user-name>
<password>jasperadminpassword</password>
</local-tx-datasource>

</datasources>

And you'll need to modify the WEB-INF/applicationContext.xml file-- replace the datasource bean def with this:

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:${metadata.hibernate.dataSource.jndiName}"/>
    </bean>

Then, create a WEB-INF/jboss-web.xml file:

<jboss-web>
<context-root>/jasperserver</context-root>
<resource-ref>
<res-ref-name>jdbc/jasperserver</res-ref-name>
<jndi-name>jdbc/jasperserver</jndi-name>
</resource-ref>
</jboss-web>

And you're in (probably not quite like flynn). So- pretty much, we unzipped the .war into the deploy directory, and made the above config changes, and, fingers croxxed, it starts up!

BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.000. Contact Blog Owner