[vbox-dev] XPCOM error NS_ERROR_FACTORY_NOT_REGISTERED
Frank Mehnert
Frank.Mehnert at Sun.COM
Mon May 25 09:47:25 GMT 2009
On Saturday 23 May 2009, Eduardo Robles Elvira wrote:
> On Fri, Apr 24, 2009 at 12:30 PM, Eduardo Robles Elvira
>
> <edulix at gmail.com> wrote:
> > Hola!
> >
> > Precisely I'm working in a patch to make virtualbox host-only and
> > internal networks work in "mesh" mode. So that I can configure each
> > interface connected to a network to which other network interfaces is
> > it directly connected to. I want to do that for testing using
> > virtuabox my final project which is an implementation of the AODV mesh
> > networks routing protocol. Yesterday I "finished" the patch i.e. it
> > compiles and in theory it should work but I didn't have enough time
> > yet to test it. I attach it to this email so that others can review
> > the patch and/or help me developing it. My final aim is that it works
> > and it gets integrated in trunk :P. Any comments about this patch are
> > welcome!
> >
> > Regards,
> > Eduardo Robles Elvira.
>
> Hi everyone,
>
> This is a follow-up of my patch for mesh networks. I'm testing it,
> but I get the XPCOM error "NS_ERROR_FACTORY_NOT_REGISTERED". The error
> shows up when I try to start a VM, when I click configure, when I
> fininsh the new VM assistant, etc. The error shows up in this code:
>
> src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp:981
> void VBoxSelectorWnd::vmStart():
> session.createInstance (CLSID_Session);
> if (session.isNull())
> {
> vboxProblem().cannotOpenSession (session); <<<<<<<<<<<<
> return;
> }
> src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp:844
> void VBoxSelectorWnd::vmSettings():
> // open a direct session to modify VM settings
> QString id = item->id();
> CSession session = vboxGlobal().openSession (id);
> if (session.isNull())
> return;
>
> src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp:2363
> CSession VBoxGlobal::openSession (const QString &aId, bool
> aExisting /* = false */)
> {
> CSession session;
> session.createInstance (CLSID_Session);
> if (session.isNull())
> {
> vboxProblem().cannotOpenSession (session); <<<<<<<<<<
> return session;
> }
>
> As you can see in the patch, I register a new XPCOM interface in
> src/VBox/Main/xpcom/module.cpp as I was told:
>
> +NS_DECL_CLASSINFO(NetworkAdapterRef)
> +NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NetworkAdapterRef, INetworkAdapterRef)
>
> If I comment those two lines the error doesn't show up but well then
> NetworkAdapter related things obviosly don't work fine (rest of the
> patch is dependent of this). So.. I don't know what's happening, can
> someone please try to enlighten me?
Hint: Use a debug build and try to start a VM like this:
./VBoxSVC
in one terminal and
./VirtualBox --startvm VM_NAME
in another terminal. This will show you the reason for your problem:
nsNativeComponentLoader: SelfRegisterDll(VBoxC.so) Load FAILED with
error: /home/fm3/src/vbox/out/linux.x86/debug/bin/components/VBoxC.so:
undefined symbol: _ZN17NetworkAdapterRefD1Ev
Fix: Remove the changes to xpcom/module.cpp from your patch.
After that you will get another assertion in CFGMR3AreValuesValid().
The reason is that you insert 'MeshEnabled' at the wrong place --
see your change in src/VBox/Main/ConsoleImpl2.cpp -- pCfg is not
correcly initialized.
Kind regards,
Frank
--
Dr.-Ing. Frank Mehnert Sun Microsystems, Inc. www.sun.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090525/75833717/attachment.sig>
More information about the vbox-dev
mailing list