Project: Birt
Bug 163732 [regression] TPTP reports can not be generated using XML datasource
Reported: 2006-11-07 18:49:15 | Status: closed fixed

I get a DataException when trying to generate a report that is bindeded to an xml stream. I tried the following BIRT driver: 2.2.0-N20061106. This is a blocker for TPTP since all BIRT reports cannot be generated. The tptp reports are generated within an ecilpse tool that generates a XML stream. This XML stream is passed to the report via a context map as shown in the following code snippet. HashMap contextMap = new HashMap(); contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext); contextMap.put(Constants.APPCONTEXT_INPUTSTREAM , xmlInput); contextMap.put(Constants.APPCONTEXT_CLOSEINPUTSTREAM , "true"); IReportRunnable report = null; try { report = engine.openReportDesign(templateFile); report.getDesignHandle().getModule().getSession().setResourceLocator(resourceLocator); } catch (EngineException e) { engine.destroy(); throw e; } IRunAndRenderTask task = engine.createRunAndRenderTask(report); task.setAppContext(contextMap); The above code worked in 2.1.1. It seems something has changed. I should also mention that the template files do refer to a xml file on my d drive. However I was under the impression that if I specify a XML stream at runtime this XML stream would be first considered as the datasource before BIRT tries to open up the file specified in the report template. I get the following error. + Cannot open the connection for the driver: org.eclipse.datatools.enablement.oda.xml unknown protocol: d odaconsumer.CannotOpenConnection ( 2 time(s) ) detail : org.eclipse.birt.data.engine.core.DataException: Cannot open the connection for the driver: org.eclipse.datatools.enablement.oda.xmlunknown protocol: d at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:148) at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:133) at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:121) at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource(DataSourceRuntime.java:206) at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:257) at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:202) at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:396) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:145) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:134) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:125) at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:120) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:146) at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1647) at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:62) at org.eclipse.birt.report.engine.executor.ExtendedItemExecutor.execute(ExtendedItemExecutor.java:79) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:35) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutChildren(HTMLBlockStackingLM.java:63) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:171) at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:94) at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutChildren(HTMLInlineStackingLM.java:138) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:171) at org.eclipse.birt.report.engine.layout.html.HTMLRowLM.layout(HTMLRowLM.java:33) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutChildren(HTMLBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:74) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:171) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layoutChildren(HTMLPageLM.java:139) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:81) at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:80) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:225) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:147) at org.eclipse.tptp.platform.report.birt.core.provisional.BIRTReportGenerator.generateHTMLReportFragment(BIRTReportGenerator.java:248) at org.eclipse.tptp.platform.report.birt.core.provisional.BIRTReportGenerator.generateHTMLReport(BIRTReportGenerator.java:154) at org.eclipse.tptp.platform.report.birt.core.internal.impl.ReportElementImpl.generate(ReportElementImpl.java:194) at org.eclipse.tptp.monitoring.log.provisional.export.BIRTExportHandler.exportLog(BIRTExportHandler.java:84) at org.eclipse.tptp.monitoring.log.provisional.export.AbstractExportHandler.exportLog(AbstractExportHandler.java:41) at org.eclipse.tptp.monitoring.report.birt.ui.internal.BIRTLogReportWizard.export(BIRTLogReportWizard.java:242) at org.eclipse.tptp.monitoring.report.birt.ui.internal.BIRTLogReportWizard.generate(BIRTLogReportWizard.java:191) at org.eclipse.hyades.ui.internal.wizard.HyadesReportWizard$FinishOperation.execute(HyadesReportWizard.java:187) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:101) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:113) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851) at org.eclipse.hyades.ui.internal.wizard.HyadesReportWizard.performFinish(HyadesReportWizard.java:141) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:684) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.hyades.trace.ui.internal.actions.OpenTraceReportAction.run(OpenTraceReportAction.java:57) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)Caused by: org.eclipse.datatools.connectivity.oda.OdaException: unknown protocol: d at org.eclipse.datatools.enablement.oda.xml.util.XMLDataInputStreamCreator.<init>(XMLDataInputStreamCreator.java:154) at org.eclipse.datatools.enablement.oda.xml.util.XMLDataInputStreamCreator.getCreator(XMLDataInputStreamCreator.java:48) at org.eclipse.datatools.enablement.oda.xml.impl.Connection.open(Connection.java:56) at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaConnection.open(OdaConnection.java:235) at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java:136) ... 81 more

Files changed in fix:
data/org.eclipse.birt.report.data.oda.xml/src/org/eclipse/birt/report/data/oda/xml/Constants.java data/org.eclipse.birt.report.data.oda.xml/src/org/eclipse/birt/report/data/oda/xml/impl/Connection.java