Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
Integrating BIRT with Siemens Teamcenter PLM
Migrateduser
<p>Hi everybody!</p>
<p>I am faced with problem while doing integration BIRT with Teamcenter that is RCP/Eclipse based application. I am using version of BIRT 4.4.1. I created plug-in project, adds BIRT plug-ins to classpath.</p>
<p>Code of my reporting is following:</p>
<p> </p>
<div><strong><em>public class ReportOperation {</em></strong></div>
<div> </div>
<div><strong><em>public static final String BIRT_HOME = "C:/ReportEngine";</em></strong></div>
<div> </div>
<div><strong><em>public void Report(String title) </em></strong></div>
<div><strong><em> {</em></strong></div>
<div><strong><em> { </em></strong></div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em> EngineConfig config;</em></strong></div>
<div><strong><em> IReportEngineFactory factory;</em></strong></div>
<div><strong><em> IReportEngine engine = null; </em></strong></div>
<div><strong><em> IReportRunnable report = null;</em></strong></div>
<div><strong><em> IRunAndRenderTask task = null;</em></strong></div>
<div><strong><em> HTMLRenderOption options;</em></strong></div>
<div> </div>
<div><strong><em> config = new EngineConfig();</em></strong></div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em> </em></strong></div>
<div><strong><em> <span> </span>config.setEngineHome(BIRT_HOME);</em></strong></div>
<div> </div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em>try{</em></strong></div>
<div> </div>
<div><strong><em> <span> </span></em></strong></div>
<div><strong><em>ReportEngine engine = new ReportEngine(config);</em></strong></div>
<div> </div>
<div><em><strong>System.out.println("Engine ver.: "+engine.getVersion()+ " Engine: " + engine.toString());</strong></em></div>
<div> </div>
<div><strong><em>report = engine.openReportDesign("D:/Reports/forma_B_report.rptdesign");</em></strong></div>
<div> </div>
<div><strong><em>task = engine.createRunAndRenderTask(report);</em></strong></div>
<div> </div>
<div><strong><em>task.setParameterValue("ReportName", title);</em></strong></div>
<div><strong><em> </em></strong><strong><em> </em></strong></div>
<div><strong><em>options = new HTMLRenderOption();</em></strong></div>
<div><strong><em> </em></strong></div>
<div><strong><em>options.setOutputFileName("D:/Reports/report.pdf");</em></strong></div>
<div><strong><em>options.setOutputFormat("pdf");</em></strong></div>
<div><strong><em>options.setEmbeddable(false);<span> </span></em></strong></div>
<div><strong><em>task.setRenderOption(options);</em></strong></div>
<div> </div>
<div> </div>
<div><strong><em>task.run();</em></strong></div>
<div> </div>
<div><strong><em>task.close();</em></strong></div>
<div><strong><em>engine.destroy();</em></strong></div>
<div> </div>
<div> </div>
<div><strong><em>System.out.println("Ready");</em></strong></div>
<div> </div>
<div><strong><em>}</em></strong></div>
<div><strong><em>catch(Exception e){</em></strong></div>
<div><strong><em>e.printStackTrace();</em></strong></div>
<div><strong><em>}</em></strong></div>
<div> </div>
<div> </div>
<div><strong><em>try<span> </span>{</em></strong></div>
<div><strong><em>engine.destroy();</em></strong></div>
<div> </div>
<div> </div>
<div><strong><em>}</em></strong></div>
<div><strong><em>catch (Exception e1)<span> </span>{</em></strong></div>
<div><strong><em> e1.printStackTrace();<span> </span></em></strong></div>
<div><strong><em>}</em></strong></div>
<div> </div>
<div><strong><em>}</em></strong></div>
<div><strong><em> }</em></strong></div>
<div> </div>
<div><strong><em>}</em></strong></div>
<div> </div>
<div>The ERROR is:</div>
<div> </div>
<div>
<div><strong><em>WARN : 11:31:24,569 - TcLogger$IC_PrintStream.log:?</em></strong></div>
<div><strong><em>Can not load the report engine</em></strong></div>
<div> </div>
<div><strong><em>ERROR: 11:31:24,569 - TcLogger$IC_PrintStream.logButCheckForException:?</em></strong></div>
<div><strong><em>java.lang.NullPointerException</em></strong></div>
<div><strong><em>java.lang.NullPointerException</em></strong></div>
<div><strong><em>at org.eclipse.birt.report.engine.api.ReportEngine.getVersion(ReportEngine.java:576)</em></strong></div>
<div><strong><em>at com.nami.reports2.handlers.ReportOperation.Report(ReportOperation.java:105)</em></strong></div>
<div><strong><em>at com.nami.reports2.handlers.SampleHandler$2.widgetSelected(SampleHandler.java:135)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)</em></strong></div>
<div><strong><em>at com.nami.reports2.handlers.SampleHandler.execute(SampleHandler.java:61)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)</em></strong></div>
<div><strong><em>at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)</em></strong></div>
<div><strong><em>at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)</em></strong></div>
<div><strong><em>at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)</em></strong></div>
<div><strong><em>at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)</em></strong></div>
<div><strong><em>at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)</em></strong></div>
<div><strong><em>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)</em></strong></div>
<div><strong><em>at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)</em></strong></div>
<div><strong><em>at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)</em></strong></div>
<div><strong><em>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)</em></strong></div>
<div><strong><em>at com.teamcenter.rac.aifrcp.Application.runApplication(Unknown Source)</em></strong></div>
<div><strong><em>at com.teamcenter.rac.aifrcp.Application.start(Unknown Source)</em></strong></div>
<div><strong><em>at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)</em></strong></div>
<div><strong><em>at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)</em></strong></div>
<div><strong><em>at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)</em></strong></div>
<div><strong><em>at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)</em></strong></div>
<div><strong><em>at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)</em></strong></div>
<div><strong><em>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</em></strong></div>
<div><strong><em>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)</em></strong></div>
<div><strong><em>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)</em></strong></div>
<div><strong><em>at java.lang.reflect.Method.invoke(Unknown Source)</em></strong></div>
<div><strong><em>at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)</em></strong></div>
<div><strong><em>at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)</em></strong></div>
<div><strong><em>at org.eclipse.equinox.launcher.Main.run(Main.java:1438)</em></strong></div>
<div><strong><em>at org.eclipse.equinox.launcher.Main.main(Main.java:1414)</em></strong></div>
<div> </div>
</div>
<div>But if i use line <strong>RegistryProviderFactory.releaseDefault(); </strong>in code below, before Engine creation line</div>
<div>the engine starts but when i close my dialog window (SWT window) Teamcenter get crushed and not working correctly.</div>
<div>Please help to solve the problem.</div>
<div> </div>
Find more posts tagged with
Comments
There are no comments yet