I have understood why this happens, but still don't know how to fix it.
What happens is that nsDirectoryService just cannot find file of this type,
"UMimTyp" (or NS_APP_USER_MIMETYPES_50_FILE). There are two providers which
do know about this file type, nsXREDirProvider (in toolkit\xre and it goes
into xulapp_s.lib) and nsProfileDirServiceProvider (in
profile\dirserviceprovider\src and goes into profdirserviceprovider_s.lib),
but none of them seem to be active when xulrunner I built is running. The
other available providers don't know this file type, therefore it doesn't
gets found.
By the way, in mozilla-1.7, nsProfileDirServiceProvider used to be in
profile.dll which was in components, but now it seems to be part of the
photon only (or I have misunderstood the makefiles). I am using
xulrunner-1.9.0.6 at the moment.
Some additional search revealed that it seems to be a known problem, judging
from the workaround for that very file type in
\_tests\xpcshell-simple\test_uriloader_exthandler\unit\head_handlerService.js:
//**************************************************************************//
// Initialization & Destruction
init: function HandlerServiceTest_init() {
// Register ourselves as a directory provider for the datasource file
// if there isn't one registered already.
try { this._dirSvc.get("UMimTyp", Ci.nsIFile) }
catch (ex) { this._dirSvc.registerProvider(this) }
// Delete the existing datasource file, if any, so we start from
scratch.
// We also do this after finishing the tests, so there shouldn't be an
old
// file lying around, but just in case we delete it here as well.
this._deleteDatasourceFile();
// Turn on logging so we can troubleshoot problems with the tests.
var prefBranch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
prefBranch.setBoolPref("browser.contentHandling.log", true);
},
destroy: function HandlerServiceTest_destroy() {
// Delete the existing datasource file, if any, so we don't leave test
files
// lying around and we start from scratch the next time.
this._deleteDatasourceFile();
},
//**************************************************************************//
// nsIDirectoryServiceProvider
getFile: function HandlerServiceTest_getFile(property, persistent) {
this.log("getFile: requesting " + property);
persistent.value = true;
if (property == "UMimTyp") {
var datasourceFile = this._dirSvc.get("CurProcD", Ci.nsIFile);
datasourceFile.append("mimeTypes.rdf");
return datasourceFile;
}
// This causes extraneous errors to show up in the log when the
directory
// service asks us first for CurProcD and MozBinD. I wish there was a
way
// to suppress those errors.
this.log("the following NS_ERROR_FAILURE exception in " +
"nsIDirectoryServiceProvider::getFile is expected, " +
"as we don't provide the '" + property + "' file");
throw Cr.NS_ERROR_FAILURE;
},
//**************************************************************************//
Nevertheless... My .mozconfig is the following, may be something wrong here?
I mean, is there a way to have xulapp_s.lib incorporated into xul in such a
way that nsXREDirProvider will be also available? Or is this not supposed to
be done? How on earth can this file be found, then?..
GLIB_PREFIX=$MOZ_TOOLS
LIBIDL_PREFIX=$MOZ_TOOLS
# Options for 'configure' (same as command-line options).
ac_add_options --disable-mailnews
ac_add_options --disable-ldap
ac_add_options --disable-composer
ac_add_options --enable-crypto
#ac_add_options --enable-static
#ac_add_options --disable-libxul
#ac_add_options --enable-componentlib
ac_add_options --disable-accessibility
# OPTIONS FOR RELEASE
#MOZ_PROFILE=1
#ac_add_options --disable-debug
#ac_add_options --disable-logging
#ac_add_options --enable-optimize=-O2
# OPTIONS FOR DEBUG
ac_add_options --enable-debug
# NEW OPTIONS
#ac_add_options --enable-application=xulrunner
ac_add_options --enable-application=browser
#ac_add_options --enable-libxul
mk_add_options moz_objd...@topsrcdir@/o...@config_guess@
#enable mfcconfig
ac_add_options --enable-tests
# minus vista
ac_add_options --disable-vista-sdk-requirements
# minus java
ac_add_options --disable-javaxpcom
# with Windows XP support
ac_add_options --with-windows-version=501
# plus xpfe
ac_add_options --enable-xpfe-components
#LDFLAGS="-MANIFESTUAC:NO"
--
View this message in context:
http://www.nabble.com/error-in-nsHandlerService.js-tp22290784p22319219.html
Sent from the Mozilla - Embedding mailing list archive at Nabble.com.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding