Re: FinalizeParams failed when accessing custom component from Java

Marcus Better <[email protected]> Wed, 01 Aug 2007 16:25:08 +0200
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <46B097C4.1040501__29605.9118969881$1185978353$gmane$org@bindows.net>
Quoting myself:
> I have implemented some XPCOM components in JavaScript, but when I try 
> to access them, JavaXPCOM throws an exception like this:
> 
> org.mozilla.xpcom.XPCOMException: FinalizeParams failed  (0x80004005)

Looking at nsJavaWrapper.cpp, at the end of callXPCOMMethod(),

   if (NS_FAILED(rv)) {
     ThrowException(env, rv, "FinalizeParams failed");
     return nsnull;
   }

it seems that this code path can actually be taken for other reasons 
than FinalizeParams() failing. For instance if the call to 
GetIIDForMethodParam() a few lines above fails, then it will not call 
FinalizeParams() at all, but NS_FAILED(rv) will still be true. So it's 
not clear to me where it fails.

Marcus