2014-07-04 19 views
2

我创建了一个XML数据源,用于从本地应用程序获取XML数据。当创建一个数据集时,我得到以下错误。BIRT:无法检索XML数据源。 XML数据源文件无效或文件不存在

org.eclipse.datatools.connectivity.oda.OdaException: XML data source cannot be retrieved. XML data source file is invalid or the file doesn't exist. 
    at org.eclipse.datatools.enablement.oda.xml.ui.wizards.XPathChoosePage.populateXMLTree(XPathChoosePage.java:482) 
    at org.eclipse.datatools.enablement.oda.xml.ui.wizards.XPathChoosePage.createPageCustomControl(XPathChoosePage.java:121) 
    at org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage.createControl(DataSetWizardPage.java:123) 
    at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:174) 
    at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:736) 
    at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1182) 
    at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1241) 
    at org.eclipse.jface.wizard.WizardDialog.access$4(WizardDialog.java:1238) 
    at org.eclipse.jface.wizard.WizardDialog$8.run(WizardDialog.java:1227) 
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) 
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1225) 
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:915) 
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:428) 

的XML URL retuns以下数据:

<table> 
    <row> 
    <marketName>dd</marketName> 
    <commodityName>Black Barley</commodityName> 
    <priceType>Wholesale</priceType> 
    <pricePerQtl>58.0</pricePerQtl> 
    <date>2014-07-03 15:18:21</date> 
    </row> 
</table> 
+0

你能提供更多的细节,如软件的版本? – Miki

+0

@Miki春天工具套件 版本:3.5.1.RELEASE 版本ID:201405030657 平台:Eclipse的开普勒SR2(4.3.2) –

+0

我可以根据您的数据在BIRT 4.3.2报告生成。您是否仅在应用程序或BIRT设计器中遇到问题? – Miki

回答

2

我只能在只在一个场景重现此即有开始标记之前的空白。所以请确保没有空格。

<?xml version="1.0" encoding="UTF-8"?> 
<table> 
    <row> 
    <marketName>dd</marketName> 
    <commodityName>Black Barley</commodityName> 
    <priceType>Wholesale</priceType> 
    <pricePerQtl>58.0</pricePerQtl> 
    <date>2014-07-03 15:18:21</date> 
    </row> 
</table> 
+0

我的XML源码不会产生'<?xml'标签,并且它不会在开始时产生一个空白区域 –

+0

是您的“测试连接”成功正在创建数据源? –

+0

是的,它是成功的。 –

1

enter image description here 这发生在我身上时,我点击这个 ^未来。

正如你可以看到它是说Use the XML file defined in datasource
但你的数据源您提供它url这样的解决方案:你的数据源
使用XML文件,直到你完成你的报表设计。

然后,一旦您完成设计,将您的数据源指向url

OR
url需要认证和安全过滤器重定向你试图访问URL时,登录页面。
因此,您可能需要:
跳过验证URL以某种方式验证报告引擎请求。