Error in an application integrating report engine [message #653650] |
Thu, 10 February 2011 09:30  |
Eclipse User |
|
|
|
Hi all,
I am currently integrating the report engine into a client/server application. The engine is on the server side and is due to send reports as byte arrays towards the client which will open them.
Using Maven, I uploaded the Birt libraries onto the maven repository and set the BIRT_HOME to a location on my machine for test purpose which is obviously different from the maven repo.
The app compiles, but when launching the report, an exception occurs at the engine.openReportDesign("") level. The thing is that when launching the report with the same BIRT_HOME and the ReportEngine in the classpath (thus no maven) from a simple project, the report is generated.
I sense that this is a version problem, but I don't know where to look. Some insight would be most welcome.
Thanks!
the code that launches the report:
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
EngineConfig config = new EngineConfig();
config.setBIRTHome("C:\\Documents and Settings\\sco\\Bureau\\birtruntime\\ReportEngine");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
IReportEngine engine = factory.createReportEngine(config);
IReportRunnable design = engine.openReportDesign("C:\\Documents and Settings\\sco\\Bureau\\birtruntime\\ReportEngine\\samples\\customers.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
task.setParameterValue("languageParameter", language);
PDFRenderOption options = new PDFRenderOption();
options.setOutputStream(bos);
options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
Platform.shutdown();
} catch(Exception e) {
e.printStackTrace();
}
return bos.toByteArray();
And the exception:
10 févr. 2011 11:22:24 org.eclipse.birt.report.model.metadata.MetaDataReader read
GRAVE: null
java.lang.NullPointerException
at org.eclipse.birt.report.model.core.DesignElement.initSlots(DesignElement.java:2990)
at org.eclipse.birt.report.model.elements.ReportDesignImpl.<init>(ReportDesignImpl.java:82)
at org.eclipse.birt.report.model.elements.ReportDesign.<init>(ReportDesign.java:52)
at org.eclipse.birt.report.model.parser.DesignParserHandler.<init>(DesignParserHandler.java:49)
at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:86)
at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:315)
at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:294)
at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:158)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:255)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:274)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:196)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:130)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:295
[Updated on: Thu, 10 February 2011 09:32] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10860 seconds