Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324580 - Default system web browser: Error opening browser
Summary: Default system web browser: Error opening browser
Status: NEW
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: jst.server (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Angel Vera CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 09:15 EDT by Missing name CLA
Modified: 2018-01-29 01:13 EST (History)
4 users (show)

See Also:


Attachments
Eclipse Error while deploying java ee web application to google app engine (78.00 KB, text/html)
2018-01-29 01:13 EST, Vicky Choudhary CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2010-09-06 09:15:27 EDT
Build Identifier: 20100617-1415

When the default system web browser is set opening the browser fails and generates this output in the log:

!ENTRY org.eclipse.wst.server.ui 4 0 2010-09-06 14:07:54.215
!MESSAGE Error opening browser
!STACK 0
java.lang.IllegalArgumentException: Argument cannot be null
	at org.eclipse.swt.SWT.error(SWT.java:4064)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.SWT.error(SWT.java:3969)
	at org.eclipse.swt.program.Program.execute(Program.java:1128)
	at org.eclipse.ui.internal.browser.SystemBrowserInstance.openURL(SystemBrowserInstance.java:46)
	at org.eclipse.wst.server.ui.internal.webbrowser.OpenBrowserWorkbenchAction.run(OpenBrowserWorkbenchAction.java:62)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)

I tried to append to eclipse.ini
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner/xulrunner
or 
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.9.2.8/xulrunner
But the Internal Web Browser option dissapears and nothing is solved.

I also have instaled the Chrome browser and I have set this browser as default and it does not work, however if I define manualy Chrome as a external browser it works (but if I define firefox it does not).

My computer has Ubuntu 10.4 and it is a fresh instalation.

Reproducible: Always

Steps to Reproduce:
1.Select Default system web browser in Window:Web Browser
2.In the PHP perspective: click the Open Web Browser icon or by running/debugging a PHP file
Comment 1 Paul Webster CLA 2010-09-07 08:18:39 EDT
Chris, does this type of error mean there's no browser configured on the path?

PW
Comment 2 Chris Goldthorpe CLA 2010-09-20 14:17:24 EDT
It does look as though the browser is not being found in the expected location - what version of Linux does the problem occur on and what is the hardware?
Comment 3 Missing name CLA 2010-09-27 14:19:58 EDT
(In reply to comment #1)
> Chris, does this type of error mean there's no browser configured on the path?
> 
> PW

I dont know how to debug, but before I reported the bug I inspected the source code and it seems to me that the problem is that the java method gets an empty browser path.
On the other hand, at system level, I have to say that the browser is well defined, it appears in the Ubuntu preferences and it works when is requested to be open.
Comment 4 Missing name CLA 2010-09-27 14:22:41 EDT
(In reply to comment #2)
> It does look as though the browser is not being found in the expected location
> - what version of Linux does the problem occur on and what is the hardware?

I have Ubuntu 10.4
My computer is a Acer TravelMate 5720
The java installed is Sun Java 1.6.0_20
Comment 5 Remy Suen CLA 2011-01-10 10:46:40 EST
(In reply to comment #2)
> It does look as though the browser is not being found in the expected location
> - what version of Linux does the problem occur on and what is the hardware?

The problem is that a 'null' is being passed to Program's execute(String) method. The javadoc itself states that an IllegalArgumentException will be thrown if 'null' is passed in so SWT is correct here. UA should either a) safe up the code here or b) make it explicit in IWebBrowser's openURL(URL) method that 'null' is not a valid parameter. WST should also change their code so that they don't pass in a 'null' in their OpenBrowserWorkbenchAction class.
Comment 6 Chris Goldthorpe CLA 2011-01-10 14:39:47 EST
Looking at the stack trace it seems that it is WTP and not the UA component that is handling the opening of the browser. Transferring to WTP.
Comment 7 Angel Vera CLA 2011-01-10 17:18:22 EST
It sounds like we are trying to calculate the URL for the object that you have selected to RunOnServer and for some reason we are getting 'null'.  I suspect this is not a problem with our code but rather an adopter. 

Where you did downloaded the PHP plugins from?
Comment 8 Remy Suen CLA 2011-01-10 17:28:58 EST
(In reply to comment #7)
> It sounds like we are trying to calculate the URL for the object that you have
> selected to RunOnServer and for some reason we are getting 'null'.  I suspect
> this is not a problem with our code but rather an adopter.

I disagree.

(In reply to comment #0)
> java.lang.IllegalArgumentException: Argument cannot be null
>     at org.eclipse.swt.SWT.error(SWT.java:4064)
>     at org.eclipse.swt.SWT.error(SWT.java:3998)
>     at org.eclipse.swt.SWT.error(SWT.java:3969)
>     at org.eclipse.swt.program.Program.execute(Program.java:1128)
>     at
> org.eclipse.ui.internal.browser.SystemBrowserInstance.openURL(SystemBrowserInstance.java:46)
>     at
> org.eclipse.wst.server.ui.internal.webbrowser.OpenBrowserWorkbenchAction.run(OpenBrowserWorkbenchAction.java:62)

Please see line 62...

http://dev.eclipse.org/viewcvs/viewvc.cgi/servertools/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/webbrowser/OpenBrowserWorkbenchAction.java?view=markup&revision=1.3&root=WebTools_Project

> browser.openURL(null);

The 'null' that is passed into the IWebBroser instance is explicitly set as 'null' in the source code.
Comment 9 Angel Vera CLA 2011-01-11 10:15:31 EST
Remy, good point. I do wonder how that code ever worked if null is not a valid argument. Will need to look into it, we haven't changed that code in a while. 

Now there is still some a question as to why during the 'running/debugging a PHP file' there is a problem. I am assumming that Manuel is doing a RunOnServer action on the PHP file from some view?
Comment 10 Vicky Choudhary CLA 2018-01-29 01:13:38 EST
Created attachment 272444 [details]
Eclipse Error while deploying java ee web application to google app engine

Hi, I am getting an error message like below while deploying Java web application through Eclipse.