Home
Analytics
Help please - Report Engine does not work in deployed Eclipse Application
qos
Hello,
I have an eclipse based application that generates rptDocuments and lists them to end users so they can export to pdf, html, xls, etc.
Both work perfectly if I run my application from eclipse ide (3.4.2), when I try the deployed application nothing happens and only have a log in <birt_home>/ReportEngine/configuration
!SESSION 2010-10-21 12:22:08.278
eclipse.buildId=unknown
java.version=1.5.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_PT
!ENTRY org.eclipse.birt.core 4 0 2010-10-21 12:22:08.278
!MESSAGE
!STACK 0
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.2.0,4.0.0)"
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
!ENTRY org.eclipse.osgi 4 0 2010-10-21 12:22:08.285
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.birt.core_2.3.2.r232_20090204a.jar/ was not resolved.
Already checked and org.eclipse.birt.core_2.3.2.r232_20090204a.jar is in reportengine/plugins. Also tried to have reportengine plugins in my application dropins folder but still have the same error.
The code i am using to get engine instance is:
EngineConfig dConfig = new EngineConfig();
dConfig.setEngineHome(birt_home);
dConfig.setLogConfig(null, Level.OFF);
dConfig.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, this.getClass().getClassLoader());
engine = new ReportEngine(dConfig);
Can you please help me?
Thanks in advance
Find more posts tagged with
Comments
JasonW
Is this plugin in the plugins directory?
org.eclipse.core.runtime
Jason
qos
Hello Jason,
Thanks for your help.
Yes it is. In <birt_home>/plugins i have org.eclipse.core.runtime_3.4.0.v20080512.jar. I had already checked that, sorry i didn't refer it.
I also have in <my_app_home>/eclipse/plugins same plugin. Do you think that osgi framework can be confused loading 2 environments?... It doesn't seem very likely ...
Don't know where else to turn to. Already tried a lot of solutions posted in the net, like java.policy, birt home as jvm environment variable, with platform, without platform ...
Any other information I can give you?
Teresa
JasonW
Teresa
Do you have all the plugins from the report engine download included?
birt-runtime-2_3_2\ReportEngine\plugins
Also verify that you have all of these plugins.
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)
";visibility:=reexport,com.ibm.icu;bundle-version="[3.4.4,4.0.0)";vis
ibility:=reexport,org.mozilla.rhino;bundle-version="[1.6.0,2.0.0)";vi
sibility:=reexport
Jason
qos
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="69594" data-time="1287674520" data-date="21 October 2010 - 08:22 AM"><p>
Teresa<br />
<br />
Do you have all the plugins from the report engine download included?<br />
birt-runtime-2_3_2\ReportEngine\plugins<br />
<br />
Also verify that you have all of these plugins.<br />
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)<br />
";visibility:=reexport,com.ibm.icu;bundle-version="[3.4.4,4.0.0)";vis<br />
ibility:=reexport,org.mozilla.rhino;bundle-version="[1.6.0,2.0.0)";vi<br />
sibility:=reexport<br />
<br />
Jason<br /></p></blockquote>
<br />
I have com.ibm.icu_3.8.1.v20080530.jar both in in <report_egine>/plugins and <my_app>/eclipse/plugins and org.mozilla.rhino_1.6.7.v20080214 only in report_egine>/plugins.<br />
<br />
My report engine config.ini is <br />
<br />
#Product Runtime Configuration File<br />
eclipse.product=org.eclipse.birt.report.engine.ReportEngineSDK<br />
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.birt.core@start<br />
osgi.framework.extensions=org.eclipse.birt.api<br />
osgi.bundles.defaultStartLevel=4
JasonW
I am not certain why you have plugins in two places but the report engine should start up where ever you set birt home. In your case is it
<birt_home>/ReportEngine
Birt home should point to a directory that contains the plugins and configuration directory. The configuration directory should only contain a config.ini
It should be started like:
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("C:\\birt\\birt-runtime-2_3_1\\birt-runtime-2_3_1\\ReportEngine");
config.setLogConfig(null, Level.OFF);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
}catch( Exception ex){
ex.printStackTrace();
}
Jason
qos
I have two places because my application is an eclipse RCP application. Should I place report engine plugins in my eclipse application plugins folder and set it as report engine home?
I will try the code you wrote and let you know later.
Thanks a lot!
Teresa
JasonW
If you already have the plugins in your app, you should not have to do a startup and you should be able to set birt home to "";
eg
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("");
config.setLogConfig(null, Level.OFF);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
}catch( Exception ex){
ex.printStackTrace();
}
Jason
qos
Hello Jason,
I was obviously approaching the problem in a wrong way, always thought that I needed a "Report Engine Home".
Googling what jars I really needed to include I came across an article of yours, don't know how I never did, and it is exactly the directions I need. I will try it now and let you know later how it ended.
http://onjava.com/pub/a/onjava/2006/07/26/deploying-birt.html?page=4
Thank you!
JasonW
Sounds good let me know.
Jason
qos
Hello Jason,
Just finnished testing generating rptdocument, with success. I followed your article that i refered before, did not include report.model dependency though, is that a problem? I started adding birt plugins to myapp/plugins by try, whenever there was a log launching eclipse i added the dependency plugin. Used the code you've posted here also.
Now generating pdf, html, xls is still not working... do i need to include the emitters plugins in my <myapp>/plugins folder?
Thanks!
qos
Done, the emitters were missing. Everything is working now! (minus the debug that stoped working but that is secondary, i'll find out a way)
Thanks again for your help, precious as always.
Have a nice weekend,
Teresa
JasonW
Glad to hear (read). Have a good weekend.