Re: Problems using trunk (1.9) XULRunner/JavaXPCOM

Christopher Rued <[email protected]> Wed, 23 Jan 2008 10:11:37 -0500
Newsgroups gmane.comp.mozilla.devel.java
Organization XSB, Inc.
Message-ID <[email protected]>
Hi,

(sorry for cross-posting, but the dev-tech-java list seems to have very 
few people responding)

I'm having a bit of trouble working with the JavaXPCOM on the trunk.   I 
built a debug version last week so that I could get a better sense of 
what may be going wrong.

In one Java thread, I get a windowWatcher by doing the following:

        serviceManager = moz.getServiceManager();
        windowWatcher = (nsIWindowWatcher) 
serviceManager.getServiceByContractID(CID_WINDOW_WATCHER, 
nsIWindowWatcher.NS_IWINDOWWATCHER_IID);

I then create a proxy to the window watcher by doing the following:

        nsIThread mainThread = threadManager.getMainThread();
        windowWatcherProxy = (nsIWindowWatcher) 
proxyObjectManager.getProxyForObject(mainThread,windowWatcher.NS_IWINDOWWATCHER_IID,windowWatcher,nsIProxyObjectManager.INVOKE_SYNC 
| nsIProxyObjectManager.FORCE_PROXY_CREATION);

Then I call:
   
    appStartup.run()

and that thread hangs up.

On a separate thread, after all of the code above has already executed, 
I do the following:

        windowWatcherProxy.openWindow(null, "http://www.google.com", 
"main", "resizable,centerscreen", null);

Which causes an assertion error:

###!!! ASSERTION: nsWindowWatcher not thread-safe: 
'_mOwningThread.GetThread() == PR_GetCurrentThread()', file 
c:/dev/xulrunner/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp, 
line 325

Am I not creating the proxy properly?  Any idea what's wrong?  Good 
documentation to read?

Thanks,

--Chris