Home » Archived » BIRT » Birt is not OSGi ready? [SOLVED](How can I deploy it inside a OSGi Ready Container)
Birt is not OSGi ready? [SOLVED] [message #1122306] |
Tue, 01 October 2013 12:29 |
Eduardo Frazão Messages: 123 Registered: January 2012 |
Senior Member |
|
|
Hi all!
I'm new to Birt, and I want to deploy it on a OSGi Ready container: Eclipse Virgo
Virgo have's a structure of "repositories", where the Birt runtime becomes a library avaliable to all bundles. I can import packages, etc.
But, even downloading the Birt OSGi Runtime (4.3.1), I note that the bundle export packages have no versions, and inside the report library directory, the genReport.sh deployment example add to classpath some non bundle libraries, like chartengineapi.jar and coreapi.jar that exists inside the lib folder.
So, i have some doubts about Birt support of OSGi.
The Birt Runtime OSGi. brings their own OSGi runtime, with Equinox extension configs, bundle activators, and normal jars to be used on the System ClassPath. So, I can assume that Birt is not 100% OSGi ready, right?. I mean, the OSGi release is not indeed to be used as bundles and coexist inside a running osgi framework? When I try to do that, I see a lot of missing dependencies from Birt bundles, etc.
Any help will be so mutch appreciated!
[Updated on: Wed, 02 October 2013 20:40] Report message to a moderator
|
|
| | |
Re: Birt is not OSGi ready? [message #1129640 is a reply to message #1129095] |
Tue, 08 October 2013 21:11 |
Eduardo Frazão Messages: 123 Registered: January 2012 |
Senior Member |
|
|
Hi Donino!
The Birt API is not OSGi ready. The API jars aren't OSGi bundles, as they does not have OSGi Manifest headers, etc.
Birt dependencies are OSGi Bundles, but theirs Manifest have some issues, like no package export versions, etc.
To make birt Work in a OSGi enviroment, when you will can in any bundle, handle their classes, you need to OSGIfy Birt, creating the Manifest Headers, and possibly fixing some dependency issues, or, you can publish the Birt API on the System ClassLoader, so, you will can import the API Packages, and have access on the classes. (the same thing that is done with "javax" for example).
The last approach is by far, more easy, but is not the best choice.
The first can work, and is the recommended way, but you will have many artefacts to mantain.
So, I try a different thing. You can embbed any JAR inside a OSGi bundle, as each bundle, have their own classpath. You can make this JAR's, part of the bundle classpath with the "Bundle-ClassPath:" manifest directive.
So, I've added all the Birt runtime inside my bundle, and as I need only simple features of Birt, I can hide the Birt API behind a simple service Facade:
public enum RenderMode {
PDF("pdf", "application/pdf"),
XLS("xls", "application/vnd.ms-excel"),
HTML("html", "text/html");
private RenderMode(String extension, String mimeType) {
this.extension = extension;
this.mimeType = mimeType;
}
private final String extension;
private final String mimeType;
public String getExtension() {
return extension;
}
public String getMimeType() {
return mimeType;
}
}
import java.io.InputStream;
/**
* A Report
* @author Eduardo Frazao
*
*/
public interface Report {
/**
*
* @return The rptdesign input stream
*/
InputStream getReportDesignFor(RenderMode mode);
}
import java.io.InputStream;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
/**
* Report Sertice
* @author Eduardo Frazao
*
*/
public interface ReportService {
/**
* A Collection of registered reports (Via OSGI Service Registry)
* @return
*/
public Collection<Report> getAllReports();
public Future<InputStream> generate(Report report, RenderMode renderMode);
public Future<InputStream> generate(Report report, RenderMode renderMode, Map<String, Object> params);
public FutureTask<InputStream> generate(Report report, RenderMode renderMode, TaskHandler<InputStream> taskHandler);
public FutureTask<InputStream> generate(Report report, RenderMode renderMode, Map<String, Object> params, TaskHandler<InputStream> taskHandler);
}
Latter, I expose a implementation of this service, that exists inside the Birt API Report Bundle. This services handle the "Report" objects, that can come from any bundle, process it, and returns the generated report as an InputStream.
I know that this is a very simplistic approach, but for now, its fine for my needs!
|
|
| | | |
Re: Birt is not OSGi ready? [message #1139663 is a reply to message #1137109] |
Tue, 15 October 2013 23:08 |
Eduardo Frazão Messages: 123 Registered: January 2012 |
Senior Member |
|
|
Hi Donino!
Here is the Manifest File. Its from the Birt 4.3.1.
Manifest-Version: 1.0
Bundle-Version: 1.0.0
Bundle-Name: Report API
Bundle-ManifestVersion: 2
Bundle-Description: Birt API Facade
Bundle-SymbolicName: br.com.bundleName
Export-Package: br.com.bundlename.report;version="1.0.0"
Bundle-ClassPath: lib/birt/axis-ant.jar,
lib/birt/axis.jar,
lib/birt/com.ibm.icu_50.1.1.v201304230130.jar,
lib/birt/com.lowagie.text_2.1.7.v201004222200.jar,
lib/birt/commons-cli-1.0.jar,
lib/birt/commons-discovery-0.2.jar,
lib/birt/derby.jar,
lib/birt/flute.jar,
lib/birt/javax.wsdl_1.5.1.v201012040544.jar,
lib/birt/javax.xml.stream_1.0.1.v201004272200.jar,
lib/birt/jaxrpc.jar,
lib/birt/js.jar,
lib/birt/org.apache.batik.bridge_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.css_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.dom_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.dom.svg_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.ext.awt_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.parser_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.pdf_1.6.0.v201105071520.jar,
lib/birt/org.apache.batik.svggen_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.transcoder_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.util_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.util.gui_1.6.0.v201011041432.jar,
lib/birt/org.apache.batik.xml_1.6.0.v201011041432.jar,
lib/birt/org.apache.commons.codec_1.3.0.v201101211617.jar,
lib/birt/org.apache.commons.logging_1.1.1.v201101211721.jar,
lib/birt/org.apache.poi_3.9.0.v201303080712.jar,
lib/birt/org.apache.xerces_2.9.0.v201101211617.jar,
lib/birt/org.apache.xml.resolver_1.2.0.v201005080400.jar,
lib/birt/org.apache.xml.serializer_2.7.1.v201005080400.jar,
lib/birt/org.eclipse.birt.runtime_4.3.1.v20130918-1142.jar,
lib/birt/org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar,
lib/birt/org.eclipse.core.expressions_3.4.500.v20130515-1343.jar,
lib/birt/org.eclipse.core.filesystem_1.4.0.v20130514-1240.jar,
lib/birt/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar,
lib/birt/org.eclipse.core.resources_3.8.101.v20130717-0806.jar,
lib/birt/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar,
lib/birt/org.eclipse.datatools.connectivity_1.2.9.v201307261105.jar,
lib/birt/org.eclipse.datatools.connectivity.apache.derby_1.0.103.v201212070447.jar,
lib/birt/org.eclipse.datatools.connectivity.apache.derby.dbdefinition_1.0.2.v201107221459.jar,
lib/birt/org.eclipse.datatools.connectivity.console.profile_1.0.10.v201109250955.jar,
lib/birt/org.eclipse.datatools.connectivity.db.generic_1.0.1.v201107221459.jar,
lib/birt/org.eclipse.datatools.connectivity.dbdefinition.genericJDBC_1.0.1.v201107221459.jar,
lib/birt/org.eclipse.datatools.connectivity.oda_3.4.1.v201308160907.jar,
lib/birt/org.eclipse.datatools.connectivity.oda.consumer_3.2.6.v201305170644.jar,
lib/birt/org.eclipse.datatools.connectivity.oda.design_3.3.6.v201212070447.jar,
lib/birt/org.eclipse.datatools.connectivity.oda.flatfile_3.1.6.v201308131104.jar,
lib/birt/org.eclipse.datatools.connectivity.oda.profile_3.2.9.v201307270622.jar,
lib/birt/org.eclipse.datatools.connectivity.sqm.core_1.2.7.v201308160952.jar,
lib/birt/org.eclipse.datatools.enablement.hsqldb_1.0.0.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.hsqldb.dbdefinition_1.0.0.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.ibm.db2.luw_1.0.2.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.ibm.db2.luw.dbdefinition_1.0.4.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.ibm.informix_1.0.1.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.ibm.informix.dbdefinition_1.0.4.v201107221502.jar,
lib/birt/org.eclipse.datatools.enablement.msft.sqlserver_1.0.3.v201308161009.jar,
lib/birt/org.eclipse.datatools.enablement.msft.sqlserver.dbdefinition_1.0.1.v201201240505.jar,
lib/birt/org.eclipse.datatools.enablement.mysql_1.0.4.v201212120617.jar,
lib/birt/org.eclipse.datatools.enablement.mysql.dbdefinition_1.0.4.v201109022331.jar,
lib/birt/org.eclipse.datatools.enablement.oda.ws_1.2.6.v201307051812.jar,
lib/birt/org.eclipse.datatools.enablement.oda.xml_1.2.5.v201305031101.jar,
lib/birt/org.eclipse.datatools.enablement.oracle_1.0.0.v201107221506.jar,
lib/birt/org.eclipse.datatools.enablement.oracle.dbdefinition_1.0.103.v201206010214.jar,
lib/birt/org.eclipse.datatools.enablement.postgresql_1.1.1.v201205252207.jar,
lib/birt/org.eclipse.datatools.enablement.postgresql.dbdefinition_1.0.2.v201110070445.jar,
lib/birt/org.eclipse.datatools.modelbase.dbdefinition_1.0.2.v201107221519.jar,
lib/birt/org.eclipse.datatools.modelbase.derby_1.0.0.v201107221519.jar,
lib/birt/org.eclipse.datatools.modelbase.sql_1.0.6.v201208230744.jar,
lib/birt/org.eclipse.datatools.modelbase.sql.query_1.1.4.v201212120619.jar,
lib/birt/org.eclipse.emf_2.6.0.v20130902-0605.jar,
lib/birt/org.eclipse.emf.common_2.9.1.v20130827-0309.jar,
lib/birt/org.eclipse.emf.ecore_2.9.1.v20130827-0309.jar,
lib/birt/org.eclipse.emf.ecore.change_2.9.0.v20130827-0309.jar,
lib/birt/org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar,
lib/birt/org.eclipse.equinox.app_1.3.100.v20130327-1442.jar,
lib/birt/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar,
lib/birt/org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar,
lib/birt/org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar,
lib/birt/org.eclipse.orbit.mongodb_2.10.1.v20130422-1135.jar,
lib/birt/org.eclipse.osgi_3.9.1.v20130814-1242.jar,
lib/birt/org.eclipse.osgi.services_3.3.100.v20130513-1956.jar,
lib/birt/org.eclipse.update.configurator_3.3.200.v20130326-1319.jar,
lib/birt/org.w3c.css.sac_1.3.0.v200805290154.jar,
lib/birt/org.w3c.dom.smil_1.0.0.v200806040011.jar,
lib/birt/org.w3c.dom.svg_1.1.0.v201011041433.jar,
lib/birt/saaj.jar,
lib/birt/Tidy.jar,
lib/birt/viewservlets.jar,
lib/postgresql-9.2-1002.jdbc4.jar,
.
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 19 20:20:58 GMT 2024
Powered by FUDForum. Page generated in 0.04090 seconds
|