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)
Chart generating problem in BIRT Runtime 2.6.1
vba
Hi,
I've just caught the problem of chart generating in BIRT Runtime of version higher then 2.5.0. And maybe, somebody also has caught the similar problem.
In our system which is stanalone java application (server side, without GUI) we are using the BIRT Runtime to generate the reports in runtime. We are using BIRT Runtime v.2.5.0. But if only I am switching to some higher version (2.5.1, 2.5.2, 2.6.0 or at current moment 2.6.1) our reports using the charts generating functionality are became failed to run. And the problem is appeared when we call build() method of Generator class. There is thrown exception with long stacktrace and main message "org.osgi.framework.BundleException: The activator org.eclipse.birt.chart.plugin.ChartEngineExtensionPlugin for bundle org.eclipse.birt.chart.engine.extension is invalid" which Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.Plugin
I've spent a lot of time to resolve this problem but without success :-( One main thing I think I've understood that problem is linked to OSGI fraimwork which cann't to activate ChartEngineExtensionPlugin plugin. After debugging with source code I've found that exception is thrown from OSGI when there is called the method getPluginXmlObject() of PluginSettings class during chart building.
Is anybody also has caught such a problem? Maybe, there should be done additional settings for OSGI fraimwork? Or there is changed steps to build and generate the charts from runtime.
Please, give a feedback
Find more posts tagged with
Comments
JasonW
Are you running the chart engine or the report engine when you get this error?
Are you using a BIRT_HOME?
Jason
vba
Thanks a lot to you Jason for your replay!
And regarding your questions. I am running the report engine. And yes, there is used BIRT_HOME path when setup the report engine. Report engine is created and setup during start up of our application. In addition there are added all the libs .jar from BIRT/lib to our application's classpath. Also there are added to classpath the followings .jars org.eclipse.birt.chart.device.extension_2.6.1.v20100902.jar and org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar from BIRT/plugins.
Chart engine is used only to get instance of ChartEngine (chartEngine = ChartEngine.instance();) and then during chart generating to get renderer (IDeviceRenderer render = chartEngine.getRenderer("dv.PNG");) and to build chart (GeneratedChartState gcs = chartEngine.getGenerator().build(render.getDisplayServer(), createdChart, bo, null, null, null);) But this can be done without ChartEngine instance at all as it is described at
http://www.eclipse.org/articles/article.php?file=Article-BIRTChartEngine/index.html
. Only to use directly Generator class (Generator gr = Generator.instance(); state = gr.build(...)). And I tried this case too
Here is also some details from our functionality when we generate the chart. The createdChart I've mentioned above is ChartWithAxes. It is created by ChartWithAxes chart = ChartWithAxesImpl.create(); and then it is setup before using: there are created Axis, Series etc.
When debugging with BIRT source here is the methods list which are called before exception:
- GeneratedChartState gcs = chartEngine.getGenerator().build(render.getDisplayServer(), createdChart, bo,
null, null, null);
- brna = BaseRenderer.instances( cmRunTime, rtc, oComputations ); in build() method of Generator
- ar = ( se.getClass( ) == SeriesImpl.class ) ? new EmptyWithAxes( ): (AxesRenderer) ps.getRenderer(
se.getClass( ) ); in method instances() of BaseRenderer
- and at the end it is called getPluginXmlObject() in PluginSettings which calls 'return icea[j].createExecutableExtension( sXsdElementValue );' which causes exception throwing
JasonW
Generally that error is thrown when a specific plugin you are using is not available or the plugin.xml format is not correct. Is there any way you write a simple version that causes the problem so I could reproduce the issue?
Jason
vba
Ok, I'll try to construct such a simple program version.
Thanks
Vasyl
vba
Hi Jason,
I've created a small test program which allows as to reproduce the error with chart creation. In attachments you can find the main program file TestChartCreation.java
I used Eclipse 3.6.1 which was installed on my drive C: in folder "C:/eclipse".
BIRT Runtime 2.6.1 was also copied to drive C: by path "C:/ReportEngine".
I've created a test project test_birt_chart in workspace "C:/test_project". There is available only one main class TestChartCreation in the project.
All the libs from "C:/ReportEngine/lib" where added to project's classpath and in addition the followings .jars org.eclipse.birt.chart.device.extension_2.6.1.v20100902.jar and org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar from the "C:/ReportEngine/plugins" folder.
The error is also appeared when it is executed "GeneratedChartState gcs = chartEngine.getGenerator().build(render.getDisplayServer(), chart, bo, null, null, null)" :-(
vba
Hi Jason,
Sorry for my disturbing but is there any idea about that problem with chart generating? Maybe it is available some workaround how to generate the chart in other way: maybe using directly the classes from org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar?
JasonW
I ran your test and did not get any error.
The only difference is the only jars in my build path where the ones from the report engine's lib directory. Can you try this?
Also when getting the chart engine you can specify the config like:
ChartEngine chartEngine = ChartEngine.instance(eConf);
Jason
vba
Hi Jason,
First of all thanks for your replay. I tried to run my test program with only jars in build path from the report engine's lib directory. And it also was without any errors!! So, it is only one but main different :-)
Thank you again that you tried this test program and you has found this different! I really appraise this! It was really a serious problem because we have a lot of reports using chart generating.
It seems there is happened some problem when we include the .jars org.eclipse.birt.chart.device.extension_2.6.1.v20100902.jar and org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar from report engine's plugins directory. But these jars was included into build path for some special reason :-) We just have one special report which uses org.eclipse.birt.chart.extension.datafeed.StockEntry when genearting the chart. And this StockEntry is available in org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar.
How I should figure out with this issue? Is there available some workaround how to use StockEntry but without including the org.eclipse.birt.chart.engine.extension_2.6.1.v20100902.jar in build path?
Maybe, to use the method Platform.getBundle("org.eclipse.birt.chart.engine.extension").loadClass("org.eclipse.birt.chart.extension.datafeed.StockEntry")
And one more question :-) You wrote to use ChartEngine chartEngine = ChartEngine.instance(eConf);
Here eConf is the same as for report engine initialization (eConf = new EngineConfig(); eConf.setBIRTHome("C:/ReportEngine"); eConf.setLogConfig(null, Level.OFF))
Or it should be the other config file and other steps to create the PlatformConfig class?
JasonW
The answer to the second question is yes.
When starting the chart engine in a simple java app you have two choices:
PlatformConfig pf = new PlatformConfig();
pf.setProperty("STANDALONE", true);
ChartEngine ce = ChartEngine.instance(pf);
or
PlatformConfig pf = new PlatformConfig();
pf.setBIRTHome("C:/birt/birt-runtime-2_6_1/birt-runtime-2_6_1/ReportEngine");
//Either add the chart sdk or runtime to your eclipse plugins and set BIRT home to that directory
//which must include the osgi plugin or use the BIRT runtime
//pf.setBIRTHome("C:/birt/birt-charts-2_2_1_1/ChartSDK/Eclipse/");
//Returns a singleton instance of the Chart Engine
ChartEngine ce = ChartEngine.instance(pf);
The issue you are having appears to be a bug with packaging. I am checking into it. One temporary solution would be just to create a new jar with the stockentry class from the extension jar and add to the classpath.
Jason
JasonW
BTW is there a reason you can not just use the standalone method?
Jason
vba
Thanks for the answers. And regarding your question.
"use the standalone method" -- you mean here why we don't use simply a report designer to construct the report. This special report was created by my collaborator and as he told me it was very difficult to construct it from report designer because of it's complex content :-(
Therefor it is built in runtime.
I'll try to use your temporary solution with special jar containing stockentry class.
It would be nice to have resolved that bug with packaging you mentioned before. Because in BIRT Runtime 2.5.0 it works: I mean our special report built with chart.engine.extension jar in build classpath
Thanks again for the replay and please notify me if there will be some solution regarding this bug with packaging
JasonW
I am still looking into this issue and will let you know when we have a better solution.
Jason
vba
Thanks a lot!