Page 1 of 1

loadComponentFromURL crashing

Posted: Mon Jul 30, 2012 9:26 pm
by rjsteele
I posted this in the Macros forum, but think it may be the wrong forum. Hopefully, this is the correct forum. There are updates here though.

I am trying to connect to a remote instance of StarOffice 9(basis3.1) on Solaris 10 x86, however, I am having some strange inconsistencies. On some systems, my application successfully launches the SpreadSheet application by using the bootstrap method, although it fails if I use a user that did not compile the code. However, on other systems (same architecture), the SpreadSheet application will not launch unless I already have StarOffice running, otherwise it throws com.sun.star.lang.DisposedException: java.io.Exception. Any help on this matter would be greatly accepted.

I've narrowed it down to this call:
ProtertyValue[] load_props = new PropertyValue[0];
XComponent comp = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, load_props);

This call never returns and is throwing the exception.

Thanks in Advanced,

Raymond

Re: loadComponentFromURL crashing

Posted: Mon Jul 30, 2012 11:18 pm
by Villeroy
Array load_props has one element but the property struct is empty.
Pass an empty array without any property struct if you don't need any additional information.

Re: loadComponentFromURL crashing

Posted: Thu Aug 02, 2012 2:22 am
by rjsteele
Thanks for the response. I'm not sure if this is what you meant, but I did the following with the same results.

PropertyValue[] load_props = new PropertyValue[0];
load_props[0] = new PropertyValue();
XComponent comp = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, load_props);

Any ideas?

Re: loadComponentFromURL crashing

Posted: Sat Aug 11, 2012 10:36 am
by hol.sten
rjsteele wrote:I am trying to connect to a remote instance of StarOffice 9(basis3.1) on Solaris 10 x86
That's an environment I've never used. So all I can give you is a little bit of general advice, although that might not be helpful in your case.
rjsteele wrote:I've narrowed it down to this call:
ProtertyValue[] load_props = new PropertyValue[0];
XComponent comp = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, load_props);

This call never returns and is throwing the exception.
This two lines are ok. I've used myself this line, always without any problems:

Code: Select all

XComponent comp = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, new PropertyValue[0]);
So, in my opinion, we both use the same load_props in the loadComponentFromURL() call. If this statements throws an exception, it might be caused by an unsatisfactory initialized xComponentLoader. You didn't post your code, how you initialize that loader and didn't describe how you call that code. So, just as a wild guess, give the bootstrapconnector a try: http://user.services.openoffice.org/en/ ... pconnector