Community
Participate
Working Groups
Build Identifier: birt-runtime-3_7_0 After restarting the reporting engine in a JUnit test, the following exceptions occur: java.lang.RuntimeException: java.lang.RuntimeException: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform Caused by: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81) ... 28 more Caused by: org.eclipse.birt.core.framework.FrameworkException: Cant register the ExtensionRegistry classpath at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:99) at org.eclipse.birt.core.framework.Platform.startup(Platform.java:75) ... 29 more Caused by: org.eclipse.core.runtime.CoreException: Extension registry provider is already set. at org.eclipse.core.internal.registry.RegistryProviderFactory.setDefault(RegistryProviderFactory.java:31) at org.eclipse.core.runtime.RegistryFactory.setDefaultRegistryProvider(RegistryFactory.java:129) at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:84) ... 30 more The workaround is to add RegistryProviderFactory.releaseDefault(); when shutting down the engine Reproducible: Always Steps to Reproduce: EngineConfig engineConfig = new EngineConfig(); Platform.startup(engineConfig); IReportEngineFactory reportEngineFactory = (IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY); reportEngine = reportEngineFactory.createReportEngine(engineConfig); ...
I can reproduce it on Linux, on BIRT 3.7.0. Workaround works, thanks david :) . Should "RegistryProviderFactory.releaseDefault();" be written somewhere in the BIRT cleanup code?
Hi, Could you please tell what to add to my java code to fix this? My code goes like this ... task.run(); task.close(); engine.destroy(); } catch (Exception ex) { ex.printStackTrace(); } finally { Platform.shutdown(); } .. I don't know how to put the "RegistryProviderFactory.releaseDefault()"...thanks for your help
This is how I used it: engine.destroy(); Platform.shutdown(); RegistryProviderFactory.releaseDefault(); engine = null; (In reply to comment #2) > Hi, > > Could you please tell what to add to my java code to fix this? > > My code goes like this > ... > > task.run(); > task.close(); > engine.destroy(); > } catch (Exception ex) { > ex.printStackTrace(); > } finally { > Platform.shutdown(); > } > .. > > I don't know how to put the "RegistryProviderFactory.releaseDefault()"...thanks > for your help
Problem solved! It worked like you said, but first I had to import the Class using "import org.eclipse.core.internal.registry.RegistryProviderFactory;" (In reply to comment #3) > This is how I used it: > > engine.destroy(); > Platform.shutdown(); > RegistryProviderFactory.releaseDefault(); > engine = null; > > (In reply to comment #2) > > Hi, > > > > Could you please tell what to add to my java code to fix this? > > > > My code goes like this > > ... > > > > task.run(); > > task.close(); > > engine.destroy(); > > } catch (Exception ex) { > > ex.printStackTrace(); > > } finally { > > Platform.shutdown(); > > } > > .. > > > > I don't know how to put the "RegistryProviderFactory.releaseDefault()"...thanks > > for your help
Set this bug as worksforme based on comment #3
But it was only a workaround. It is not mentioned in a documentation, e.g. http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#reportengine or Integrating and Extending book. Should it be at least documented or fixed?
Changes made to: http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#reportengine Jason
Eclipse doesn't find the class RegistryProviderFactory, which jar contains this class? (In reply to comment #3) > This is how I used it: > > engine.destroy(); > Platform.shutdown(); > RegistryProviderFactory.releaseDefault(); > engine = null; > > (In reply to comment #2) > > Hi, > > > > Could you please tell what to add to my java code to fix this? > > > > My code goes like this > > ... > > > > task.run(); > > task.close(); > > engine.destroy(); > > } catch (Exception ex) { > > ex.printStackTrace(); > > } finally { > > Platform.shutdown(); > > } > > .. > > > > I don't know how to put the "RegistryProviderFactory.releaseDefault()"...thanks > > for your help
You must add all the jars from the lib directory of the eclipse runtime folder to your project. (In reply to comment #8) > Eclipse doesn't find the class RegistryProviderFactory, which jar contains > this class? > > (In reply to comment #3) > > This is how I used it: > > > > engine.destroy(); > > Platform.shutdown(); > > RegistryProviderFactory.releaseDefault(); > > engine = null; > > > > (In reply to comment #2) > > > Hi, > > > > > > Could you please tell what to add to my java code to fix this? > > > > > > My code goes like this > > > ... > > > > > > task.run(); > > > task.close(); > > > engine.destroy(); > > > } catch (Exception ex) { > > > ex.printStackTrace(); > > > } finally { > > > Platform.shutdown(); > > > } > > > .. > > > > > > I don't know how to put the "RegistryProviderFactory.releaseDefault()"...thanks > > > for your help
Reopen for enhancement.
Hi there.. I tried it but din't work for me. I am using birt-runtime-3_7_2.. This is the error i am getting Caused by: org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81) at momentum.wealth.wlisp.report.birt.engine.core.BirtEngineFactory.getObject(BirtEngineFactory.java:50) ... 104 more Caused by: org.eclipse.birt.core.framework.FrameworkException: Cant register the ExtensionRegistry classpath at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:99) at org.eclipse.birt.core.framework.Platform.startup(Platform.java:75) ... 105 more Caused by: org.eclipse.core.runtime.CoreException: Extension registry provider is already set. at org.eclipse.core.internal.registry.RegistryProviderFactory.setDefault(RegistryProviderFactory.java:31) at org.eclipse.core.runtime.RegistryFactory.setDefaultRegistryProvider(RegistryFactory.java:126) at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:84) ... 106 more
fixed
*** Bug 412103 has been marked as a duplicate of this bug. ***