Home
Analytics
Integrate BIRT Engine with Glassfish V3
DavidB
Just wondering if anyone has had any success integrating the birt engine osgi plugins into glassfish v3 (also based on osgi) ?
In the past I've successfully integrated birt into glassfish v1 by booting the birt platform using glassfish's lifecycle api then exposing the report engine via jndi and dependency injection.
As glassfish v3 is also based on osgi this approach no longer makes sense if birt's plugins can be merged.
PS. Deploying birt as a WAR recommended for other application servers, would still result in an osgi runtime (birt) being started on top an already running osgi runtime (glassfish).
Best Regards
David
Find more posts tagged with
Comments
CBR
Hi David,<br />
<br />
Glassfish uses Apache Felix as its default OSGI implementation. BIRT 2.5 heavily depends on Equinox 3.5 as OSGI implementation so i would doubt that the plugins are able to run using Felix. Fortunately you are able to change the OSGI implementation of your Glassfish with minor changes (see: <a class='bbc_url' href='
http://blogs.sun.com/arungupta/entry/totd_103_glassfish_v3_with'>Arun
Gupta, Miles to go ...: TOTD #103: GlassFish v3 with different OSGi runtimes – Felix, Equinox, and Knoplerfish</a> for Howto)<br />
I think using Equinox 3.5 it should be possible to deploy the BIRT runtime plugins to your glassfish.<br />
I m really interested in what you are trying to do. Perhaps it's possible that we share knowledge as i m working on a similar topic at the moment.
kiranv
i have sucessfuly deployed a basic web application in glassfish v3. in netbeans 6.8 glassfish v3 comes bundled.. i first created a dynamic web application and then created birt reports from it.
DavidB
Thanks CBR
I haven't spend any time looking at using equinox yet.
Instead to quickly move forward I re-used my original technique for embedding Birt.
Basically I define a 'JNDI custom resource' in GlassFish with a JNDI name of 'custom/BirtEngine'. This requires a concrete implementation of 'javax.naming.spi.ObjectFactory' in my case called 'BirtEngineFactory' which starts the equinox platform and returns an instance of 'org.eclipse.birt.report.engine.api.IReportEngine' to the JNDI registry. 'BirtEngineFactory' requires an additional property called 'BIRT_HOME' that points to the location of the Birt platform in my case '${com.sun.aas.instanceRoot}/birt'.
I then use dependancy injection in my EJBs to access the JNDI resource as follows:
@Resource(name="
;custom/BirtEngine")
private IReportEngine reportEngine;
For this to work Birt's api classes must be included in the domains classpath. You do this by copying the jars from Birt's runtime lib into the domains 'lib/ext' folder.
Using this approach I'm generating reports and returning the pdf/xlsx reports via SOAP webservices to the client.
ssamayoa
<blockquote class='ipsBlockquote' data-author="'DavidB'" data-cid="59901" data-time="1265227685" data-date="03 February 2010 - 01:08 PM"><p>
Instead to quickly move forward I re-used my original technique for embedding Birt.<br /></p></blockquote>
<br />
More than a year and half later I found this very useful.<br />
<br />
Regards.