Sudhir
Sudhir

Reputation: 533

what is the URL equivalent of an absolute path in non-windows system?

I am getting following exception while running BIRT from a Linux OS.

Caused by: org.eclipse.datatools.connectivity.oda.OdaException: no protocol: /home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml

where "/home/lsingh/reporting/tmp/execution1279514184559/TDReport.xml" is my XML data file.

When i looked into the code of "org.eclipse.birt.report.data.oda.xml.util.XMLDataInputStreamCreator" class in the BIRT, I saw that the exeception is coming from following piece of code.

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

It means the code is trying to convert file path specified above into a URL and it fails.

So my question is how a non-windows path is converted into a URL? should it be prefixed with file:/// ?

Upvotes: 1

Views: 363

Answers (2)

Abhinav Sarkar
Abhinav Sarkar

Reputation: 23812

You can try using the file URL:

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

If you can post the code than invokes BIRT, it will be easier to analyse the problem.

Upvotes: 0

Konrad Garus
Konrad Garus

Reputation: 54035

Windows or not, all URLs to local files start with file://. That's the protocol prefix.

So your file would be:

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

Upvotes: 5

Related Questions