Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Unable to restart standalone BIRT engine in JUnit test code
Unable to restart standalone BIRT engine in JUnit test code [message #368818] Mon, 29 June 2009 10:16 Go to next message
Eclipse UserFriend
Originally posted by: csaba.szucs.continental-corporation.com

Hello Guys,

In my JUnit tests I start and shutdown BIRT standalone engine again and
again within each test method.

I shut down standalone BIRT engine this way, I am not sure if it is
correct or not:
engine.destroy();
Platform.shutdown();

But during the first try to restart BIRT engine I get the following
exceptions:

Could you tell me what the problem is, thanks a lot!
Csaba

Exception in thread "main" 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)
at
com.continental.plm.reportmanager.ReportEngineHandler.create EngineForStandaloneJavaPlatform(ReportEngineHandler.java:29)
at
com.continental.plm.reportmanager.ReportToolbox.getReportEng ineForStandaloneJavaPlatform(ReportToolbox.java:47)
at
com.continental.plm.reportmanager.ReportManager.<init>(ReportManager.java:40)
at
com.continental.plm.reportmanager.ReportManager.main(ReportM anager.java:231)
Caused by: java.lang.IllegalStateException
at
org.mozilla.javascript.ContextFactory.initGlobal(ContextFact ory.java:207)
at
org.eclipse.birt.report.engine.api.impl.ReportEngine.<clinit >(ReportEngine.java:221)
... 8 more

Some help for investigating the exception trace:
public static IReportEngine createEngineForStandaloneJavaPlatform(final
String birtHome) throws Exception {
EngineConfig config = new EngineConfig();
config.setEngineHome(birtHome);

Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_E NGINE_FACTORY);

return factory.createReportEngine(config);
}

So the problem is at the last statement of my above method
(ReportEngineHandler.java:29).
Re: Unable to restart standalone BIRT engine in JUnit test code [message #368822 is a reply to message #368818] Mon, 29 June 2009 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Csaba,

Can you log a bug for this? Post the bugzilla id here.

Jason

Csaba wrote:
> Hello Guys,
>
> In my JUnit tests I start and shutdown BIRT standalone engine again and
> again within each test method.
>
> I shut down standalone BIRT engine this way, I am not sure if it is
> correct or not:
> engine.destroy();
> Platform.shutdown();
>
> But during the first try to restart BIRT engine I get the following
> exceptions:
>
> Could you tell me what the problem is, thanks a lot!
> Csaba
>
> Exception in thread "main" 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)
>
> at
> com.continental.plm.reportmanager.ReportEngineHandler.create EngineForStandaloneJavaPlatform(ReportEngineHandler.java:29)
>
> at
> com.continental.plm.reportmanager.ReportToolbox.getReportEng ineForStandaloneJavaPlatform(ReportToolbox.java:47)
>
> at
> com.continental.plm.reportmanager.ReportManager.<init>(ReportManager.java:40)
>
> at
> com.continental.plm.reportmanager.ReportManager.main(ReportM anager.java:231)
>
> Caused by: java.lang.IllegalStateException
> at
> org.mozilla.javascript.ContextFactory.initGlobal(ContextFact ory.java:207)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.<clinit >(ReportEngine.java:221)
>
> ... 8 more
>
> Some help for investigating the exception trace:
> public static IReportEngine
> createEngineForStandaloneJavaPlatform(final String birtHome) throws
> Exception {
> EngineConfig config = new EngineConfig();
> config.setEngineHome(birtHome);
>
> Platform.startup(config);
> IReportEngineFactory factory = (IReportEngineFactory) Platform
>
> .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_E NGINE_FACTORY);
>
> return factory.createReportEngine(config);
> }
>
> So the problem is at the last statement of my above method
> (ReportEngineHandler.java:29).
>
>
>
Re: Unable to restart standalone BIRT engine in JUnit test code [message #368823 is a reply to message #368822] Mon, 29 June 2009 15:36 Go to previous message
Csaba  is currently offline Csaba Friend
Messages: 24
Registered: July 2009
Junior Member
Hi Jason,

here is the link to the bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281865

Csaba
Previous Topic:Hibernate and BIRT
Next Topic:Losing SeriesDefinition in Generator.build() with EcoreUtil.copy
Goto Forum:
  


Current Time: Tue Apr 23 15:10:18 GMT 2024

Powered by FUDForum. Page generated in 0.03276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top