BIRT: XML data source cannot be retrieved. XML data source file is invalid or the file doesn't exist

╄→尐↘猪︶ㄣ 提交于 2019-12-24 01:58:08

问题


I created an XML data source that fetches XML data from a local application. when creating a data set I get the following error.

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)

The XML URL retuns the following data:

<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>

回答1:


I can only reproduce this in only in one scenario i.e there is whitespace before start tag. So make sure that there are no whitespaces.

<?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>



回答2:


This happened to me when I click this^ next.

As you can see it is saying Use the XML file defined in datasource
but on your datasource you are providing it a url so the solution:
Use XML file on your data source till you finish your report design.

Then once you are done with your design point your data source to your url.

OR
Your url needs authentication and the security filter is redirecting you to login page when trying to access the url.
So you may need to:
skip authenticating the url or somehow authenicate the report engine request.



来源:https://stackoverflow.com/questions/24575209/birt-xml-data-source-cannot-be-retrieved-xml-data-source-file-is-invalid-or-th

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!