Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » [Resolved] JAR file calling Birt, problems Upgrading to 3.7
[Resolved] JAR file calling Birt, problems Upgrading to 3.7 [message #714832] Thu, 11 August 2011 15:14 Go to next message
Graham  is currently offline Graham Friend
Messages: 2
Registered: August 2011
Junior Member
Having problems upgrading from 2.6.2 to 3.7
Previously from our JAR
ReportEngine engine = null;
EngineConfig config = new EngineConfig();
config.setLogConfig(sBirtEngineLogPath, LBirtLogLevel);
config.setLogFile(sBirtLogFileName);
config.setBIRTHome( sBirtEnginePath );
engine = new ReportEngine( config );

In the Birt home directory there was the ReportEngine folder from the 2.6.2 runtime download.
In our JAR class path there was also the jars from the ReportEngine\lib directory
The JAR would run and render a report and write it to a specified directory. Worked well.

Now upgrading to 3.7:
To my understanding we HAVE to use the OSGI framework for a stand alone jar.

Downloaded the 3.7 runtime and replaced the old ReportEngine folder with the new one.
Copied the jars from the ReportEngine\lib directory into the class path (removed all the old ones)
The migration guide said to remove setBIRTHome and that should be the only code changes required. Tried that and it crashed.
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.

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.

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.
In the plugins folder I don't really know what should go there so i just copied everything from ReportEngine\lib to it.
Had no idea what the config.ini should be so i adapted from the 2.6.2 version.
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

"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.
The "org.eclipse.birt.api" was not included in any runtime download, but on the Birt FAQ
(wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_can_I_generate_org.eclipes.birt.api.jar_for_ReportEngine.3F)
i found how to create it. Created it and added it to the plugins folder.

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.

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.
The arguments are from: config.getOSGiArguments( )

So, there you have it. I don't know if i have the wrong JARs somewhere or the config.ini file is wrong or ....

All help greatly appreciated,
Graham

Edit: have also posted at www.birt-exchange.org/org/forum/index.php/topic/23141-jar-file-calling-birt-problems-upgrading-to-37/

[Updated on: Thu, 11 August 2011 17:28]

Report message to a moderator

Re: JAR file calling Birt, problems Upgrading to 3.7 [message #714872 is a reply to message #714832] Thu, 11 August 2011 15:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Graham,

For the 3.7 runtime it do not use OSGi. So all you should have to do is
get the jars from the reportengine/lib directory in the runtime download
and add them to your classpath. Remove old jars, delete the
configuration and plugins folder and do not set birt home. Can you try
this?

Jason


On 8/11/2011 11:14 AM, Graham wrote:
> Having problems upgrading from 2.6.2 to 3.7
> Previously from our JAR
>
> ReportEngine engine = null;
> EngineConfig config = new EngineConfig();
> config.setLogConfig(sBirtEngineLogPath, LBirtLogLevel);
> config.setLogFile(sBirtLogFileName);
> config.setBIRTHome( sBirtEnginePath );
> engine = new ReportEngine( config );
>
> In the Birt home directory there was the ReportEngine folder from the
> 2.6.2 runtime download. In our JAR class path there was also the jars
> from the ReportEngine\lib directory
> The JAR would run and render a report and write it to a specified
> directory. Worked well.
>
> Now upgrading to 3.7:
> To my understanding we HAVE to use the OSGI framework for a stand alone
> jar.
>
> Downloaded the 3.7 runtime and replaced the old ReportEngine folder with
> the new one.
> Copied the jars from the ReportEngine\lib directory into the class path
> (removed all the old ones)
> The migration guide said to remove setBIRTHome and that should be the
> only code changes required. Tried that and it crashed. 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.
>
> 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.
> 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. In
> the plugins folder I don't really know what should go there so i just
> copied everything from ReportEngine\lib to it.
> Had no idea what the config.ini should be so i adapted from the 2.6.2
> version.
> 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
>
> "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. The "org.eclipse.birt.api" was not included in any
> runtime download, but on the Birt FAQ
> (wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_can_I_generate_org.eclipes.birt.api.jar_for_ReportEngine.3F)
>
> i found how to create it. Created it and added it to the plugins folder.
> 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.
>
> 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. The arguments are from: config.getOSGiArguments( )
>
> So, there you have it. I don't know if i have the wrong JARs somewhere
> or the config.ini file is wrong or ....
>
> All help greatly appreciated,
> Graham
Re: JAR file calling Birt, problems Upgrading to 3.7 [message #714896 is a reply to message #714872] Thu, 11 August 2011 17:27 Go to previous messageGo to next message
Graham  is currently offline Graham Friend
Messages: 2
Registered: August 2011
Junior Member
Wow....
I could have sworn I did that first because thats what the migration guide said but I must have missed something because I just tried it again and... it works!
Wow... lot of wasted time on my part

Thanks very much.
Graham
Re: [Resolved] JAR file calling Birt, problems Upgrading to 3.7 [message #722915 is a reply to message #714832] Wed, 07 September 2011 07:50 Go to previous messageGo to next message
samalairbien is currently offline samalairbienFriend
Messages: 1
Registered: September 2011
Junior Member
Hi.

I'm migrating from Birt 2.3 to 3.7 too.
It works fine.
But I would like to know if some JARs are optional in ReportEngine/lib. Because there are more than 70 JARs in this directory, and I ask me if they are all necessary (if I can evict to install all in my artifactory...).

Thanks in advance.
Re: [Resolved] JAR file calling Birt, problems Upgrading to 3.7 [message #723538 is a reply to message #722915] Thu, 08 September 2011 18:35 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This will depend on what features you are using. If you look at the
datatools jars several of these can be removed if you are not using the
data sources.

Jason

On 9/7/2011 3:50 AM, samalairbien wrote:
> Hi.
>
> I'm migrating from Birt 2.3 to 3.7 too.
> It works fine.
> But I would like to know if some JARs are optional in ReportEngine/lib.
> Because there are more than 70 JARs in this directory, and I ask me if
> they are all necessary (if I can evict to install all in my
> artifactory...).
>
> Thanks in advance.
Previous Topic:Does anyone has this problem?
Next Topic:Unable to convert a date string to a Date object in BIRT
Goto Forum:
  


Current Time: Sat Apr 20 03:06:17 GMT 2024

Powered by FUDForum. Page generated in 0.03376 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top