Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT API and tomcat
kosta
Hello BIRT community,
I am using BIRT as BIRT API in my java application. No we have part of it as web
project on a tomcat server. Some classes are using the birt-api engine for
creating reports (still the old 2.6.2 BIRT version).
The question is, should the methods be invoked as if they where used from java
application or it is better to use some "war" version of the birt so I dont need
the path ot the external ReportEngine folder but it will be loaded via tomcat.
Thanks in advance.
Find more posts tagged with
Comments
johnw
You can, technically, put your libs in the WAR without any issues, as long as BIRT_HOME points to some folder containing the expected OSGi structure (/plugins, /configuration, etc). If this is included as part of the WAR file, then BIRT_HOME will need to point to the folder that the WAR file will ultimately extract out to. So no matter what you do, you will need to set BIRT_HOME. The only exception is if BIRT was executed inside the OSGi environment.
kosta
Thanks John,
That means I need the BIRT_HOME folder ind both cases. Even if the application is saved as war the BIRT_HOME folder must be extracted out of it.
What do you mean by "The only exception is if BIRT was executed inside the OSGi environment."?
You mean by that the exeption of not using explicit a BIRT_HOME folder?
As far as I know the BIRT 2.6.2 starts the OSGI server in background. In the eclipse RCP it doesnt needed.
But I thought there are some exeption using web the application.
Someone told me on one BIRT workshop about some "war"-file (the BIRT previewer) that he found in the web. So I thought there is some BIRT enviroment extra for it. Maybe it was the newest version of BIRT.
johnw
The only exception in the case of a web server would be if you were running Jetty, in which case OSGi would already be started and the BIRT plugins would already be registered and ready to start.
Platform.startup() is basically wrapper code the bootstraps an OSGi environment when you are working with BIRT in something like a Java app or a J2EE app. If you were running in an Eclipse RCP app, or a Jetty web app, you wouldn't need to call Platform.startup().
The newest version of BIRT is the exception. As of 3.7, there is a seperate build that does not require OSGi. This is the default Runtime API with 3.7
kosta
The information about the jetty web server is something new for me through.
About the version 3.7 I have heard that they are not based on OSGi any more, so I can use the elipse plugin-jars as if they were casual java jars putting them on the classpath.
Thats why I am not migrating the BIRT to 3.7. I must test the all enviroment of its behavior. The problems there is that I have custom report items and the fonts which are now in the font plugin jar.
From that what Jason told me is that the custom report items plugins should be on the class path too and everthing would work fine. About the fonts there was a link where the fonts are set over some system property or some similar approach.
johnw
You should just need to copy your custom plugins into the lib folder with the other libraries. As long as your classpath includes everything under that folder, you should be fine. This will include custom fonts. Worst case scenario is that you might need to extract the org.eclipse.birt.runtime.XXXXX.jar and modify the font config under there. But your custom report items will just get copied as if the lib folder was the plugins folder under OSGi.
Do a search under DevShare on BIRT Exchange. Someone asked specifically about the fonts with 3.7.x sometime back, I just dont remember the exact answer.
kushal2605
Probably there are both option either to keep birt.war in webapps directory but better way is to attach the birt project files in your project.
you can merge both web.xml files to achieve that and copy webcontent folder and all jars of birt.war in your project.