Bug 466391 - Error in console when running Browser with XULRunner 31
Summary: Error in console when running Browser with XULRunner 31
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5   Edit
Hardware: PC All
: P3 normal with 4 votes (vote)
Target Milestone: 4.6   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 437700
  Show dependency tree
 
Reported: 2015-05-05 05:25 EDT by Lakshmi P Shanmugam CLA
Modified: 2016-03-04 09:43 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lakshmi P Shanmugam CLA 2015-05-05 05:25:28 EDT
The following error is printed to the console when launching a SWT.Mozilla style Browser with XULRunner 31.
addons.manager	ERROR	startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource://gre/modules/AddonManager.jsm :: AMI_startup :: line 645"  data: no] Stack trace: AMI_startup()@resource://gre/modules/AddonManager.jsm:645 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2318 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>
Comment 1 Lakshmi P Shanmugam CLA 2015-05-13 16:09:11 EDT
Hi Matt,
Do you know why this error occurs?
I've investigated this for a while. From the call trace in the error message, the error occurs at resource://gre/modules/AddonManager.jsm:645 which is Services.prefs.setCharPref(PREF_EM_LAST_APP_VERSION,
                                   Services.appinfo.version);
I'm not sure what is the problem, as this doesn't occur in older versions.
Comment 2 Matt Painter CLA 2015-05-13 16:23:45 EDT
(In reply to Lakshmi Shanmugam from comment #1)
> Hi Matt,
> Do you know why this error occurs?
> I've investigated this for a while. From the call trace in the error
> message, the error occurs at resource://gre/modules/AddonManager.jsm:645
> which is Services.prefs.setCharPref(PREF_EM_LAST_APP_VERSION,
>                                    Services.appinfo.version);
> I'm not sure what is the problem, as this doesn't occur in older versions.

Is Services.appinfo.version undefined? From the error it looks like it's either undefined or the wrong type.

This bug would seem to concur: https://bugzilla.mozilla.org/show_bug.cgi?id=820818
Comment 3 Lakshmi P Shanmugam CLA 2015-05-14 07:40:35 EDT
(In reply to Matt Painter from comment #2)
> (In reply to Lakshmi Shanmugam from comment #1)
> > Hi Matt,
> > Do you know why this error occurs?
> > I've investigated this for a while. From the call trace in the error
> > message, the error occurs at resource://gre/modules/AddonManager.jsm:645
> > which is Services.prefs.setCharPref(PREF_EM_LAST_APP_VERSION,
> >                                    Services.appinfo.version);
> > I'm not sure what is the problem, as this doesn't occur in older versions.
> 
> Is Services.appinfo.version undefined? From the error it looks like it's
> either undefined or the wrong type.
> 
> This bug would seem to concur:
> https://bugzilla.mozilla.org/show_bug.cgi?id=820818

I don't think SWT sets the appinfo.version anywhere. It should be set in the application.ini, right? That's not used in SWT XULRunner support.
Any other insights would be useful.
Comment 4 Josef Schachinger CLA 2015-05-20 03:48:40 EDT
We are following the progress of XULRunner 31 support with much interest, since it would give us huge JavaScript-Performance improvements.

Can you give an estimate, when this bug will be fixed?
Comment 5 Lakshmi P Shanmugam CLA 2015-05-20 03:54:45 EDT
(In reply to Josef Schachinger from comment #4)
> We are following the progress of XULRunner 31 support with much interest,
> since it would give us huge JavaScript-Performance improvements.
> 
> Can you give an estimate, when this bug will be fixed?

I'm still investigating how to get rid of this error. See earlier comments for details. Any insights on how to fix this would be helpful.

Does it affect any feature or functionality for you? In my investigation/tests it is only a error printed to the console, but doesn't affect any feature of the browser.
Comment 6 Josef Schachinger CLA 2015-05-20 07:56:00 EDT
(In reply to Lakshmi Shanmugam from comment #5)
> I'm still investigating how to get rid of this error. See earlier comments
> for details. Any insights on how to fix this would be helpful.
> 
> Does it affect any feature or functionality for you? In my
> investigation/tests it is only a error printed to the console, but doesn't
> affect any feature of the browser.

We use http://djproject.sourceforge.net/ns/index.html to integrate a browser in our Java-Swing-UI-based application.

Now we would like to use XULRunner 31, but it only displays a gray screen. During analysis we noticed the error and found this bug.

Since in your case it does not affect browser functionality, we are not sure whether this bug really is the cause of our problem - we have to investigate this further.
Comment 7 Lakshmi P Shanmugam CLA 2015-05-20 08:02:02 EDT
On which platform did you test? We have an issue with XULRunner 31 support on Linux (Bug 467646). It works fine on Windows and MacOSX.
Comment 8 Josef Schachinger CLA 2015-05-20 08:04:33 EDT
(In reply to Lakshmi Shanmugam from comment #7)
> On which platform did you test? We have an issue with XULRunner 31 support
> on Linux (Bug 467646). It works fine on Windows and MacOSX.

Our platform is Windows 7.
Comment 9 Daniel Stainhauser CLA 2015-05-20 14:20:35 EDT
We are also using Windows 7 32 bit and XULRunner 31 does not work on an RCP application that worked fine with 21.

This is the error printed. 

1430748349755	addons.manager	ERROR	startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.setCharPref]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: resource://gre/modules/AddonManager.jsm :: AMI_startup :: line 645"  data: no] Stack trace: AMI_startup()@resource://gre/modules/AddonManager.jsm:645 < AMP_startup()@resource://gre/modules/AddonManager.jsm:2318 < AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>

Then, the browser window is empty.

Using XULRunner 31 is very important for us as the font rendering is much improved compared to version 21.

Thanks.
Comment 10 Lakshmi P Shanmugam CLA 2015-05-21 02:24:45 EDT
(In reply to Daniel Stainhauser from comment #9)
> We are also using Windows 7 32 bit and XULRunner 31 does not work on an RCP
> application that worked fine with 21.
> 
> This is the error printed. 
> 
> 1430748349755	addons.manager	ERROR	startup failed: [Exception... "Component
> returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
> [nsIPrefBranch.setCharPref]"  nsresult: "0x80070057
> (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame ::
> resource://gre/modules/AddonManager.jsm :: AMI_startup :: line 645"  data:
> no] Stack trace: AMI_startup()@resource://gre/modules/AddonManager.jsm:645 <
> AMP_startup()@resource://gre/modules/AddonManager.jsm:2318 <
> AMC_observe()@resource://gre/components/addonManager.js:55 < <file:unknown>
> 
> Then, the browser window is empty.
> 
> Using XULRunner 31 is very important for us as the font rendering is much
> improved compared to version 21.
> 
> Thanks.

XULRunner 31 works fine on Windows in-spite of the error message. Have you set the org.eclipse.swt.browser.XULRunnerPath to point to the XULRunner 31 runtime?
Can you try any of the browser snippets from here with XULRunner 31 and see if it works for you?
--> https://www.eclipse.org/swt/snippets/#browser
You need to change the Browser style to SWT.MOZILLA and set the XULRunnerPath property for the snippets to use XULRunner 31.
Comment 11 Lakshmi P Shanmugam CLA 2015-05-21 04:27:42 EDT
I also tried setting the internal browser in eclipse to use XULRunner 31 runtime.
The browser opens and works fine. I've tested this on both Windows 7 and Mac OSX.
Can you try if this works for you?

(I added the following lines to the end of eclipse.ini and started eclipse.
-Dorg.eclipse.swt.browser.DefaultType=mozilla
-Dorg.eclipse.swt.browser.XULRunnerPath=/Library/Frameworks/XUL/31/XUL.framework/Versions/Current
)
Comment 12 Michael Woldrich CLA 2015-05-22 10:09:17 EDT
When I setting this properties, I can run the snippets with style SWT.MOZILLA.
It seems the XULRunner 31 and SWT integration works. Thanks for the hint!

But we are also using the FlashPlayer and I only get a black screen. So is there any example (snippet) where I can test this scenario? Or has anybody a idea if we need another version of flashplayer plugin in xulrunner.  
For info we are adding a plugin folder to xulrunner with following files:
flashplayer.xpt
npnul32.dll
NPSWF32.dll
Comment 13 Daniel Stainhauser CLA 2015-06-01 16:12:48 EDT
I've finally managed to solve our problem.

We had a directive in our html pages

<meta http-equiv='Content-Type' content='application/xhtml+xml' />

That caused a very weird behaviour. When we added more than 4 includes with javascript into the head, the webpage was blank. It didn't even matter if the included javascript had any content.

Finally with trial and error we found out that this directive solved the problem.

<meta http-equiv='Content-Type' content='application/xhtml+xml charset=UTF-8' />

The first directive is working fine with XULRunner21 /eclipse Luna, also with Android, Safari and iOS. 

So if anybody has a similar problem with blank web pages, try to define a charset.
Comment 14 Lakshmi P Shanmugam CLA 2015-08-27 04:09:36 EDT
Moving to 4.6
Comment 15 Markus Keller CLA 2016-03-04 09:43:04 EST
XULRunner has been deprecated and removed from the source tree, see
https://groups.google.com/d/msg/mozilla.dev.platform/_rFMunG2Bgw/C-4PcHj9IgAJ

Closing this request since makes little sense to invest in a dead technology.