This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Start up NetBeans in a network environment where proxy is required (e.g. Oracle network) 2. Switch to a network environment with direct internet access (WiFi) 3. Create New HTML5 Application; select one of the Online templates in the Site Templates step => Downloading the template will time out, and the wizard will display error message "Can not prepare template "Initializr (Responsive)" (see IDE log for more details)." And the IDE log contains: java.net.ConnectException: Operation timed out at java.net.PlainSocketImpl.socketConnect(Native Method) .... at java.net.URL.openStream(URL.java:1037) at org.netbeans.modules.web.clientproject.sites.SiteHelper.download(SiteHelper.java:103) .... I.e. a network connection problem. It would be useful to give the user access to proxy settings here, so she can correct the proxy settings.
There are few places where we are downloading code from the net - templates, libraries, project samples, etc. I wonder whether we should add some helper API method to show an error dialog with a warning that download of some URLs failed and what these URLs are and also have a button to "Configure Proxy" and "Try Again" and "Cancel" of course. And we would use this error dialog whenever we failed to download something. The dialog would return results: - Cancel - TryAgain Do you think that would work Tomas?
Well, it would work I think. In this particular case, we call siteTemplate.prepare() method. But this method is not only about downloading, it is about general preparing (e.g. unzip template which can also throw an IOException) so we should add NetworkException (extends IOException) or similar and show the dialog only if this exception is thrown (it would be thrown from SiteHelper.download() in our case). One note: of course, I would like to see this kind of support in core NetBeans so everyone could benefit from it - but we can propose such API later once we know that it is useful. What do you think? BTW I should be able to implement it so feel free to reassign to me if you want to. I would also use it in the new project wizard (sorry don't know anything about libraries or samples). Thanks.
(In reply to comment #2) > One note: of course, I would like to see this kind of support in core NetBeans Yes, an API in our web.clientproject.api for now. > BTW I should be able to implement it so feel free to reassign That would be great. Thanks! > I would also use it in the new project wizard (sorry don't know anything > about libraries or samples). In "JavaScript Files" (in new project wizard or via project properties) we do downloading of remote files too, right? And MartinJ in web.clientproject.samples is reusing OnlineSites to download remote files so he could use this API too.
Fixed, any comments are welcome, of course. The "NetworkFailed" dialog is shown during: - preparing template, - downloading JS libraries (only in new project wizard; project properties stay unchanged - they only inform about failed libraries). Please verify, thanks. http://hg.netbeans.org/web-main/rev/20b02c764b72
Missing classes added, sorry. http://hg.netbeans.org/web-main/rev/262a11dc7e84
Created attachment 128424 [details] illustrative screenhost I've tried it as I have frequently problems with download of initializr templates. It works fine I think. The dialog could look slightly more appealing though - see the attachment.
Integrated into 'main-golden', will be available in build *201211270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/20b02c764b72 User: Tomas Mysik <tmysik@netbeans.org> Log: #221505 - Provide access to proxy settings from HTML5 Application wizard
I see; I will likely truncate the given URLs... Thanks for catching that.
(In reply to comment #8) > I see; I will likely truncate the given URLs... <priority=P4>Hmmm... keeping whole URL would be good for users so that they can see what we are downloading. However if shortened URL is clickable (that is clicking it opens it using standard URLDisplayer) then it would be perfectly OK to shorten it.</priority>
Good point, I will do it if the given "request" is a URL.
Fixed. http://hg.netbeans.org/web-main/rev/f7d9df9c4a67
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f7d9df9c4a67 User: Tomas Mysik <tmysik@netbeans.org> Log: #221505 cont' - Provide access to proxy settings from HTML5 Application wizard Hyperlinks added and long requests are truncated.