Hello, all!
I have the following error when I try to run my browser that is founded
on XulRunner and JavaXPCOM. The errors happen when baseWindow.create()
method is called.
2007-08-27 15:36:53.811 java[393] *** -[NSCFType addSubview:]: selector
not recognized [self = 0x42c4af80]
2007-08-27 15:36:53.811 java[393] An uncaught exception was raised
2007-08-27 15:36:53.811 java[393] *** -[NSCFType addSubview:]: selector
not recognized [self = 0x42c4af80]
2007-08-27 15:36:53.812 java[393] *** Uncaught exception:
<NSInvalidArgumentException> *** -[NSCFType addSubview:]: selector not
recognized [self = 0x42c4af80]
On Linux and Windows this code works fine. Can anyone help me with any
suggestion?
The mos relevant part of code is presented below.
Best regards, Sergey.
----
public class XulRunnerBrowser extends Composite implements
nsIWebBrowserChrome,
nsIWebProgressListener, nsITooltipListener {
static final String ROOT_BRANCH_NAME = ""; //$NON-NLS-1$
static final String PREFERENCE_DISABLEOPENDURINGLOAD =
"dom.disable_open_during_load"; //$NON-NLS-1$
static final String PREFERENCE_DISABLEWINDOWSTATUSCHANGE =
"dom.disable_window_status_change"; //$NON-NLS-1$
private Mozilla mozilla = null;
private nsIWebBrowser webBrowser = null;
private long chrome_flags = nsIWebBrowserChrome.CHROME_ALL;
private boolean busyResizeFlag = false;
public XulRunnerBrowser(Composite parent) throws XulRunnerException {
super(parent, SWT.NONE);
mozilla = Mozilla.getInstance();
String xulRunnerPath = getXulRunnerPath();
Boolean isXulRunnerInitialized =
"true".equals(System.getProperty(XULRUNNER_INITIALIZED));
if (!isXulRunnerInitialized) {
File file = new File(xulRunnerPath);
mozilla.initialize(file);
mozilla.initEmbedding(file, file, new
AppFileLocProvider(file));
}
nsIComponentManager componentManager =
mozilla.getComponentManager();
nsIAppShell appShell = (nsIAppShell)
componentManager.createInstance(XPCOM.NS_IAPPSHELL_CID, null,
nsIAppShell.NS_IAPPSHELL_IID);
appShell.create(null, null);
appShell.spinup();
nsIServiceManager serviceManager = mozilla.getServiceManager();
nsIWindowWatcher windowWatcher = (nsIWindowWatcher)
serviceManager.getServiceByContractID(XPCOM.NS_WINDOWWATCHER_CONTRACTID,
nsIWindowWatcher.NS_IWINDOWWATCHER_IID);
windowWatcher.setWindowCreator(new WindowCreator());
setBoolRootPref(PREFERENCE_DISABLEOPENDURINGLOAD, true);
setBoolRootPref(PREFERENCE_DISABLEWINDOWSTATUSCHANGE, true);
webBrowser = (nsIWebBrowser)
componentManager.createInstance(XPCOM.NS_IWEBBROWSER_CID, null,
nsIWebBrowser.NS_IWEBBROWSER_IID); //$NON-NLS-1$
webBrowser.setContainerWindow(this);
nsIWebBrowserSetup setup = (nsIWebBrowserSetup)
webBrowser.queryInterface(nsIWebBrowserSetup.NS_IWEBBROWSERSETUP_IID);
setup.setProperty(nsIWebBrowserSetup.SETUP_IS_CHROME_WRAPPER,
1);
nsIBaseWindow baseWindow = (nsIBaseWindow)
webBrowser.queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID);
Rectangle rect = getClientArea();
if (rect.isEmpty()) {
rect.height = 1;
rect.width = 1;
}
baseWindow.initWindow(handle, 0, 0, 0, rect.height, rect.width);
/*
* error happens inside next method
*/
baseWindow.create();
baseWindow.setVisibility(true);
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding