Page 1 of 1

URL seems to be an unsupported one

PostPosted: Fri May 02, 2008 10:26 pm
by mattaspen

I spent a good part of my day trying to get the example "" to work.

System: linux, CentOs 5

In March, I was able to get this example to run and refactored it into a mini application. At the time, I was using OO 2.3.1.
In April, I upgraded to OO 2.4.0 and, have returned to my project, but kept getting the error: URL seems to be an unsupported one.

So, I revisited the 'examples' directory and started on trying to get "" working as my 1st step.
The error/result was the same. The error happens on line 116 line:

Code: Select all   Expand viewCollapse view
XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);

I searched Google and the forums and the only post that I found that is remotely related to my problem is, which states:

See ... lator.html and ... ToInternal. In short, OOo distinguishes between "internal" and "external" URIs, where Java's URIs are external, so code like

String path2 =
if (path2.length() == 0 && path.length() != 0) {
throw new RuntimeException();

is needed to translate path into path2 before using it. (And that it worked in OOo 1.3 was by chance, not by design.)

So, I spent some time trying all of the possible combinations from this post (as well as hard-coding the various "url" possibilities (on linux as "internal" and "external")), but still kept getting the same error.

Since this example originally worked (as I stated above) in OO 2.3.1, I uninstalled 2.4.0 and re-installed 2.3.1.

Unfortunately, I keep getting the same error.

To my knowledge, nothing has changed on my box; as far as settings etc.

My question, then, is: what am I doing wrong and what is/are a possible solution(s)?


Re: URL seems to be an unsupported one

PostPosted: Fri May 02, 2008 10:55 pm
by acknak
Moved to Macros & UNO API.

Re: URL seems to be an unsupported one

PostPosted: Thu May 08, 2008 12:27 pm
by mathew
Not sure if I understand your problem, but I'm wondering if you are having a problem with Java's encoding of URLs.

I use this method to hack the uri returned by URI.toString()
Code: Select all   Expand viewCollapse view
   * The {@link} method has a broken handling of file protocol.
   * The returned string starts file:/, when it should start file:///.
   * @see
   * @see
  public static String uriToString (URI uri) {
    String s = uri.toString ();
    if ("file".equals (uri.getScheme ())) {
      return "file://" + s.substring (5);
    else {
      return s;

Re: URL seems to be an unsupported one

PostPosted: Wed Dec 03, 2008 10:50 pm
by reparker2000
I had the same error, and after staring at the URL awhile, I realized that I was using a filename that had blanks in it. If you're using an OS/filesystem which requires such a pathname or filename which has special characters in it to be quoted -- surrounded by double-quotes -- then your URL will fail unless you surround at least the portion which has special charactes in it with double-quotes...or you can change the special characters to "non-special" characters. For example, I changed my blanks to underscores, and the URL no longer failed.