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)
How to correctly pack and deploy applications that use the BIRT DEAPI?
mariaux
Hi, <br />
<br />
I just started working with BIRT Design Engine API a couple of weeks ago. <br />
I built an application which is capable of designing reports programatically <br />
according to our needs. This has all worked fine so far using Eclipse. However, <br />
when packing the application into a Runnable JAR I start getting errors <br />
when rendering the reports. <br />
<br />
The type of errors that I get are not runtime errors, but simply at the time of <br />
rendering some information is lost (i.e. styles and charts). I'm attaching one <br />
of our reports rendered twice to HTML and PDF formats, first rendered running the <br />
application from Eclipse and then rendered from the executable JAR. The main <br />
differences are:<br />
<br />
* Some of the styles defined are missing in the second report.<br />
* Charts are not shown. Instead an error is posted at the bottom of the HTML. <br />
<br />
<p class='bbc_indent' style='margin-left: 40px;'><br />
Chart Shaft chart:<br />
+ exception.undefined.text.color<br /></p>
<br />
The only runtime error I get (when running the application from the JAR) occurs <br />
when rendering the reports to Excel format. The error is the following:<br />
<br />
<p class='bbc_indent' style='margin-left: 40px;'>org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.<br />
at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2360)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:191)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)<br />
at romax.reports.main.RomaxEntryPoint.renderToFile(RomaxEntryPoint.java:252)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:601)<br />
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:119)<br />
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:392)<br />
at py4j.Gateway.invoke(Gateway.java:255)<br />
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:124)<br />
at py4j.commands.CallCommand.execute(CallCommand.java:81)<br />
at py4j.GatewayConnection.run(GatewayConnection.java:175)<br />
at java.lang.Thread.run(Thread.java:722)<br />
Caused by: java.lang.ClassCastException: org.eclipse.birt.report.engine.css.engine.value.StringValue cannot be cast to org.eclipse.birt.report.engine.css.engine.value.FloatValue<br />
at org.eclipse.birt.report.engine.emitter.excel.ExcelXmlWriter.declareStyle(ExcelXmlWriter.java:515)<br />
at org.eclipse.birt.report.engine.emitter.excel.ExcelXmlWriter.declareStyles(ExcelXmlWriter.java:662)<br />
at org.eclipse.birt.report.engine.emitter.excel.ExcelXmlWriter.start(ExcelXmlWriter.java:847)<br />
at org.eclipse.birt.report.engine.emitter.excel.ExcelWriter.start(ExcelWriter.java:95)<br />
at org.eclipse.birt.report.engine.emitter.excel.layout.ExcelLayoutEngine.end(ExcelLayoutEngine.java:1071)<br />
at org.eclipse.birt.report.engine.emitter.excel.ExcelEmitter.end(ExcelEmitter.java:298)<br />
at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.end(CompositeContentEmitter.java:65)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:183)<br />
... 13 more<br /></p>
<br />
<br />
<br />
This problem is only regarding the rendering. If the report is saved and opened <br />
from the Eclipse Report perspective it can be rendered correctly (I'm also <br />
attaching the .rptdesign. All the charts and styles appear correctly. <br />
<br />
Since we have been working with the checked out source code from GIT, only one <br />
JAR is generated. This JAR contains all the classes from the imported projects <br />
merged into this one JAR.<br />
<br />
It seems that I am not packing the application correctly with the BIRT Design Engine <br />
API. My question is what is the correct way to do the packing and deployment? Is it <br />
possible to have access to the Design Engine API in JAR format? We are not really <br />
changing classes within the API.<br />
<br />
I apologise in advance if the answer to this question is trivial. Any help regarding<br />
this matter will be greatly appreciated. <br />
<br />
Thanks,<br />
<br />
Maria
Find more posts tagged with
Comments
mwilliams
All that error tells me is that somewhere in the creation of the chsrt, the text color is not getting set. Do you define a text color in your Java code when you create the chart?