1

从 Linux 操作系统运行 BIRT 时出现以下异常。

引起:org.eclipse.datatools.connectivity.oda.OdaException:无协议:/home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml

其中“/home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml”是我的 XML 数据文件。

当我查看 BIRT 中“org.eclipse.birt.report.data.oda.xml.util.XMLDataInputStreamCreator”类的代码时,我看到异常来自以下代码。

catch (MalformedURLException e)
{
  throw new OdaException(e.getLocalizedMessage());
}

这意味着代码正在尝试将上面指定的文件路径转换为 ​​URL,但它失败了。

所以我的问题是如何将非 Windows 路径转换为 ​​URL?它应该以 file:/// 为前缀吗?

4

2 回答 2

5

不管是不是 Windows,所有本地文件的 URL 都以file://. 那是协议前缀。

所以你的文件是:

file://+ /home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml=file:///home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml

于 2010-07-19T07:11:29.847 回答
0

您可以尝试使用文件 URL:

file:///home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml

如果您可以发布代码而不是调用 BIRT,则更容易分析问题。

于 2010-07-19T07:12:49.690 回答