I spent a good part of my day trying to get the example "FirstLoadComponent.java" 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:
com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
So, I revisited the 'examples' directory and started on trying to get "FirstLoadComponent.java" working as my 1st step.
The error/result was the same. The error happens on line 116 line:
Code: Select all
XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
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.See http://api.openoffice.org/docs/common/r ... lator.html and http://api.openoffice.org/docs/common/r ... ToInternal. In short, OOo distinguishes between "internal" and "external" URIs, where Java's URIs are external, so code like
String path2 = com.sun.star.uri.ExternalUriReferenceTranslator.
create(context).translateToInternal(path);
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.)
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)?
Thanks,
--MA