nsIPromptService prompt fails with NS_ERROR_FAILURE

"[email protected]" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.embedding
Organization http://groups.google.com
Message-ID <5e0e4183-01fb-469f-8387-792c77840b78@r27g2000yqb.googlegroups.com>
Working with a java embedding of xulrunner 1.9.2 as an embedded
browser. Registered a custom implementation of nsIPromptService:

registrar.registerFactory(NS_PROMPTSERVICE_CID, "Prompt Service",
NS_PROMPTSERVICE_CONTRACTID, new nsIFactory() {

   private final PromptService promptService = new
PromptService(popupService);

   public nsISupports queryInterface(String uuid) {
      if(uuid.equals(nsIFactory.NS_IFACTORY_IID) ||
uuid.equals(nsIFactory.NS_ISUPPORTS_IID)) {
         return this;
      }
      return null;
   }

   public nsISupports createInstance(nsISupports outer, String iid) {
      return promptService;
   }

   public void lockFactory(boolean lock) {
   }
});

Tried just implementing nsIPromptService, alert and confirm calls in
javascript from loaded pages work fine, prompt fails with:

[JavaScript Error: "uncaught exception: [Exception... "Component
returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)
[nsIJSCID.getService]"  nsresult: "0x80570016
(NS_ERROR_XPC_GS_RETURNED_FAILURE)"  location: "JS frame ::
file:///home/megan/Downloads/xulrunner-1.9.2/components/nsLoginManagerPrompter.js
:: anonymous :: line 150"  data: no]"]


Tried implementing nsIPromptService2, alert and confirm calls in
javascript from loaded pages work fine, prompt fails with:

[JavaScript Error: "uncaught exception: [Exception... "Component
returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIPromptService2.prompt]"  nsresult: "0x80004005
(NS_ERROR_FAILURE)"  location: "JS frame ::
file:///home/megan/Downloads/xulrunner-1.9.2/components/nsLoginManagerPrompter.js
:: anonymous :: line 267"  data: no]"]

Any help would be appreciated - not sure how to debug it further.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.