从 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:/// 为前缀吗?