Rony G. Flatscher wrote:
Hi,
w.r.t. my problem description with the subject "Runtime problems when
using Introspection&Reflection via Java" I also get a runtime error with
your program.
F:\work\tmp\ooo\test>java Introspect
Exception in thread "main" java.lang.NullPointerException
at Introspect.main(Introspect.java:28)
Line # 28 is highlighted as red and bold in your original code below:
The following Java program works just fine for me:
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XIntrospection;
import com.sun.star.beans.XIntrospectionAccess;
import com.sun.star.beans.XPropertySet;
import com.sun.star.bridge.UnoUrlResolver;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
public final class Introspect {
public static void main(String[] arguments) throws Exception {
XMultiComponentFactory factory = (XMultiComponentFactory)
UnoRuntime.queryInterface(
XMultiComponentFactory.class,
(UnoUrlResolver.create(
Bootstrap.createInitialComponentContext(null)).
resolve(
"uno:socket,host=127.0.0.1,port=12345;urp;"
+ "StarOffice.ServiceManager")));
XComponentContext context = (XComponentContext)
UnoRuntime.queryInterface(
XComponentContext.class,
(((XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, factory)).
getPropertyValue("DefaultContext")));
*XIntrospectionAccess access =
((XIntrospection) UnoRuntime.queryInterface(
XIntrospection.class,
factory.createInstanceWithContext(
"com.sun.star.beans.Introspection", context))).
inspect(
(((XComponentLoader) UnoRuntime.queryInterface(
XComponentLoader.class,
factory.createInstanceWithContext(
"com.sun.star.frame.Desktop", context))).
loadComponentFromURL(
"private:factory/scalc", "_blank",
FrameSearchFlag.CREATE, new PropertyValue[0]))); *
System.exit(0);
}
private Introspect() {}
}
So it is affected as well (does not work anymore).
In the meantime I have de-installed all OpenOffices (1.1.4, 1.9),
deleted all remainders of these installations in the file-system, tried
to find traces in the Windows registry and deleted them.
Then - after reboots - I re-installed OOo 1.9 only, but to no avail.
Are there any registry-entries which might affect this behaviour that
have keys other than "OpenOffice" or "soffice" ? Or could it be, that
some cache is being used that contains erroneous data?
There should be no registry entries that have any influence on this.
Did you re-use any old user installation (its location is determined by
line "UserInstallation=" in program\bootstrap.ini? Normally, soffice
finds services like "com.sun.star.beans.Introspection" in
program\services.rdb, which it locates via the line "UNO_SERVICES=" in
program\uno.ini ("$ORIGIN" should expand to the soffice program
directory); but if something is broken there, soffice itself would most
likely not start up at all.
Regards,
---rony
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]