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)
JAR file calling Birt, problems Upgrading to 3.7
Logic42
Having problems upgrading from 2.6.2 to 3.7<br />
Previously from our JAR<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
ReportEngine engine = null;
EngineConfig config = new EngineConfig();
config.setLogConfig(sBirtEngineLogPath, LBirtLogLevel);
config.setLogFile(sBirtLogFileName);
config.setBIRTHome( sBirtEnginePath );
engine = new ReportEngine( config );</pre>
In the Birt home directory there was the ReportEngine folder from the 2.6.2 runtime download.<br />
In our JAR class path there was also the jars from the ReportEngine\lib directory<br />
The JAR would run and render a report and write it to a specified directory. Worked well.<br />
<br />
Now upgrading to 3.7:<br />
To my understanding we HAVE to use the OSGI framework for a stand alone jar.<br />
<br />
Downloaded the 3.7 runtime and replaced the old ReportEngine folder with the new one.<br />
Copied the jars from the ReportEngine\lib directory into the class path (removed all the old ones)<br />
The migration guide said to remove setBIRTHome and that should be the only code changes required. Tried that and it crashed.<br />
I have the BIRT source code for debugging purposes. Because we are calling from a stand alone JAR file setBIRTHome is required; there's no xml file to define BIRT_HOME otherwise. Added setBIRTHome back in.<br />
<br />
Debugging into BIRT source code shows that the ReportEngine creates a platform which creates a launcher which can either be an OSGILauncher (which i think is what i want) or a ServiceLauncher which returns nulls and everything crashes.<br />
<br />
To my understanding for the OSGI framework to work, there has to be a 'plugins' folder and 'config' folder in the engine directory. In the config folder there has to be a config.ini to initialize the OSGI.<br />
In the plugins folder I don't really know what should go there so i just copied everything from ReportEngine\lib to it.<br />
Had no idea what the config.ini should be so i adapted from the 2.6.2 version.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>eclipse.product=org.eclipse.birt.report.engine.ReportEngineSDK
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.birt.runtime@start
osgi.framework.extensions=org.eclipse.birt.api
osgi.bundles.defaultStartLevel=4
eclipse.parsers.setTCCL=false</pre>
"org.eclipse.birt.runtime" used to be "org.eclipse.birt.core" but i changed it because all of the jar files from 'core' in 2.6.2 are now in 'runtime' in 3.7.<br />
The "org.eclipse.birt.api" was not included in any runtime download, but on the Birt FAQ<br />
(wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_can_I_generate_org.eclipes.birt.api.jar_for_ReportEngine.3F)<br />
i found how to create it. Created it and added it to the plugins folder.<br />
<br />
In summary have ReportEngine folder with copy of \lib as \plugins and a config folder with a modded config.ini. JARS from \lib are also in class path. Still crashes.<br />
<br />
When debugging BIRT source; when the platform creates the launcher, the launcher needs a context, PlatformFileContext returns with the 'root' value correctly as the directory engine home, but the 'arguments' value is null.<br />
The arguments are from: config.getOSGiArguments( )<br />
<br />
So, there you have it. I don't know if i have the wrong JARs somewhere or the config.ini file is wrong or ....<br />
<br />
All help greatly appreciated,<br />
Graham<br />
<br />
Have also posted at www.eclipse.org/forums/index.php/t/234591/
Find more posts tagged with
Comments
JasonW
Graham,
I posted a respone on the eclipse forum. If you have skype I can walk you through it.
Jason