Home
Analytics
ExceptionInInitializerError on redeploying the application using BIRT 2.3.2
SShetty
Hi,
We have an application(deployed in Weblogic 9.2 ) that generates PDF reports using the BIRT 2.3.2.The PDF generation works fine normally, but throws and ExceptionInInitializerError only when we undeploy and redeploy the application.The stacktrace is given below:
===========================================================================================
java.lang.ExceptionInInitializerError
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14)
Caused by: java.lang.IllegalStateException
at org.mozilla.javascript.ContextFactory.initGlobal(ContextFactory.java:207)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.<clinit>(ReportEngine.java:221)
===========================================================================================
On restarting the Weblogic Server, the above error disappears.
Earlier, we had had a conflict with weblogic.jar and the BIRT Runtime js.jar.We resolved it by modifying the weblogic startup scripts classpath to point to the BIRT js.jar.
Not sure if the above issue is also a manifestation of the same conflict.
On creating the ReportEngine object, there seems to be a static variable/initializer created in BIRT, that doesnot get released on undeploy/redeploy of the application.
Please have a look at our code below.Is there anything that we are missing here.
EngineConfig config = new EngineConfig();
String path = "E:/birt-runtime-2_3_2/ReportEngine";
config.setEngineHome(path);
// Set configuration properties on the object
HashMap hm = config.getAppContext();
hm.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, Thread.currentThread().getContextClassLoader());
hm.put("Report_Details", newReportList);
config.setAppContext(hm);
Platform.startup(config);
// Get the ReportEngine object
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
// Pass config to the report engine constructor
IReportEngine engine = factory.createReportEngine(config);
InputStream fis = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("rptdesign/PNAReport_SDS_temp.rptdesign");
// Open the Report Design
IReportRunnable design = engine.openReportDesign(fis);
// Create task to run and render the report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// Set parameter values
IRenderOption options = new RenderOption();
options.setOutputFormat("pdf");
options.setOutputStream(bos);
task.setRenderOption(options);
// Run and Render Report
task.run();
task.close();
engine.shutdown();
engine.destroy();
Any help in this regard is highly appreciated.
Thanks,
Find more posts tagged with
Comments
JasonW
Can you log a bug for this?
Jason
SShetty
Thanks Jason.
I have report this in Bugzilla.
Bug ID: 285527
Shireen
jyol2005
We are also seeing the same error with 2.5.0. Is there any resolution to this?
JasonW
Should be fixed in the 2.5.2 branch:<br />
<a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281865'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=281865</a><br
/>
<br />
Jason
jyol2005
I am testing my application with Birt 4.2.0 and I still see this issue. If I restart the server, it is working fine. Was this ever resolved?
I see the below exception when I update the deployment from WebLogic console or stop/start.
javax.servlet.ServletException: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform>
jyol2005
Anybody has any suggestions or resolution for this issue with 4.2.0?
jyol2005
I'm surprised that nobody is having this issue. Can someone from BIRT team please let me know what could be wrong with my application deployment?