Re: FinalizeParams failed when accessing custom component from Java

Marcus Better <[email protected]> Tue, 7 Aug 2007 14:50:21 +0200
Newsgroups gmane.comp.mozilla.devel.java
Organization MB Technologies
Message-ID <200708071450.22036.marcus__35693.3787152686$1186491050$gmane$org@bindows.net>
Hi,

I have run into more problems with JavaXPCOM. My test code (basically the
same as before) now works when running as a stand-alone Java application
without SWT, but fails when I run it as an Eclipse plugin.

The error is the same as before, that I get an exception when calling
getServiceByContractID for my service which is implemented in JavaScript.
In the non-Eclipse app the call succeeds. Moreover I can access built-in
XPCOM services even in the Eclipse app.

> org.mozilla.xpcom.XPCOMException: FinalizeParams failed  (0x80004005)
> at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Native
> Method) at
> org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaProxy.java:143)
> at $Proxy0.getServiceByContractID(Unknown Source)

> This is thrown by getServiceByContractID() called from my Java code:
> 
> Mozilla moz = Mozilla.getInstance();
> MyComponent comp = (MyComponent)moz.getServiceManager().getServiceByContractID(
> 	"@example.org/MyComponent;1",
> 	MyComponent.MYCOMPONENT_IID_STRING);

I am now using Xulrunner 1.8.1.6 on Linux.

My code is called from an SWT event handler linked to a push button. Could
the problem be that I am accessing the XPCOM component from different
threads? I have tried running the code in an UIJob, with the same result.

Regards,

Marcus