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.

Bug 218780 - java.net.MalformedURLException: no protocol: h/index.html
Summary: java.net.MalformedURLException: no protocol: h/index.html
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-21 13:59 UTC by Jiri Skrivanek
Modified: 2012-10-22 11:04 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 192642


Attachments
stacktrace (4.10 KB, text/plain)
2012-09-21 13:59 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2012-09-21 13:59:46 UTC
Build: NetBeans IDE 7.3 Beta (Build 201209201306)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7

User Comments:
jskrivanek: Need to handle exception when external web server is misconfigured:
- create HTML5 project
- open project properties
- choose Run category
- select External Web Server
- type just "h" into Project URL
- click OK
- run project




Stacktrace: 
java.net.MalformedURLException: no protocol: h/index.html
   at java.net.URL.<init>(URL.java:583)
   at java.net.URL.<init>(URL.java:480)
   at java.net.URL.<init>(URL.java:429)
   at org.netbeans.modules.web.clientproject.ServerURLMappingImpl.toServer(ServerURLMappingImpl.java:82)
   at org.netbeans.modules.web.clientproject.api.ServerURLMapping.toServer(ServerURLMapping.java:106)
   at org.netbeans.modules.web.clientproject.api.ServerURLMapping.toServer(ServerURLMapping.java:92)
Comment 1 Jiri Skrivanek 2012-09-21 13:59:48 UTC
Created attachment 124720 [details]
stacktrace
Comment 2 David Konecny 2012-10-17 01:01:42 UTC
Perhaps we should check whether entered value starts with "file:/" or "http:/" or "https:/"?
Comment 3 Tomas Mysik 2012-10-19 08:54:37 UTC
Or even better some regular expression for validating URL? Will fix it, let's start with just simple protocol validation.
Comment 4 Jiri Skrivanek 2012-10-19 08:57:00 UTC
At least catch the exception and provide user-friendly warning message.
Comment 5 Tomas Mysik 2012-10-20 14:26:56 UTC
Validation of project URL added to the project customizer. Jirko, could you please submit another issue for catching this exception for the Run action - assign it to me. Thanks.

http://hg.netbeans.org/web-main/rev/78aa5fc903e7
Comment 6 Quality Engineering 2012-10-21 01:44:09 UTC
Integrated into 'main-golden', will be available in build *201210210002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/78aa5fc903e7
User: Tomas Mysik <tmysik@netbeans.org>
Log: #218780 - java.net.MalformedURLException: no protocol: h/index.html
Comment 7 Jiri Skrivanek 2012-10-22 10:20:08 UTC
Verified. Not clear what you mean by "catching this exception for the Run action". If it is not possible to set invalid url then exception never appears.
Comment 8 Tomas Mysik 2012-10-22 11:04:51 UTC
(In reply to comment #7)
> If it is not possible to set invalid url then exception never appears.

I just wanted to be sure that user will not see this exception, ever. I am fine with the current state.