| Author |
JSP Proxy File returning "malformed url" error
|
Brett Spivey
Greenhorn
Joined: Feb 10, 2012
Posts: 4
|
|
I make no bones about it, I know almost nothing about JSP but have been thrown into the position of getting this to work so any help is greatly appreciated. I have a jsp file that is acting as a proxy. For some reason, it is returning a "java.net.MalformedURLException: no protocol" error. Pasting the url directly in the browser generates the correct response so it has to be something with the proxy file. Can anyone provide suggestions on how to correct this? Thanks.
JSP Proxy Code
Error Received
java.net.MalformedURLException: no protocol: http://149.168.87.13/arcgis/services/NC1Map_Boundaries/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=0,1,2,3&QUERY_LAYERS=0,1,2,3&STYLES=,,,&BBOX=-10624233.224628%2C3771371.436984%2C-7128920.79569%2C4585884.410277&FEATURE_COUNT=10&HEIGHT=333&WIDTH=1429&FORMAT=png&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A3857&X=758&Y=129 at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at org.apache.jsp.ncomOL.proxy_jsp._jspService(proxy_jsp.java:100) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
Brett Spivey wrote:I make no bones about it, I know almost nothing about JSP...
Well, that doesn't matter because what you posted is just a big chunk of Java code which has been put into a JSP scriptlet. So if you know Java, you're good to go with this problem. I will move the post to one of the regular Java forums.
|
 |
Brett Spivey
Greenhorn
Joined: Feb 10, 2012
Posts: 4
|
|
|
Okay, thanks.
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
Paul Clapham wrote:what you posted is just a big chunk of Java code which has been put into a JSP scriptlet.
Which, for your future knowledge should you ever be responsible for creating your own JSPs, is a really really really really bad practice that has been discredited for 10 years now. Just FYI.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Koen Aerts
Ranch Hand
Joined: Feb 07, 2012
Posts: 339
|
|
Is this perhaps the culprit:
"http://http://imagery.nconemap.com/ArcGIS/rest/services/"
Notice how http:// is repeated in there...
|
 |
Brett Spivey
Greenhorn
Joined: Feb 10, 2012
Posts: 4
|
|
|
Thanks for the reply. However, that isn't it.
|
 |
Koen Aerts
Ranch Hand
Joined: Feb 07, 2012
Posts: 339
|
|
|
What browser and which URL are you using to replicate this issue? I have tried in Firefox and Chrome and in both it seems to work fine. I thought perhaps the browser did some URL encoding or formatting before it submitted, causing the malformed URL in the code.
|
 |
Brett Spivey
Greenhorn
Joined: Feb 10, 2012
Posts: 4
|
|
IE5 -- just kidding on a Friday!!!
I'm using FF8.
Here is the url: http://localhost:8080/geoportal/ncomOL/proxy.jsp?http://149.168.87.13/arcgis/services/NC1Map_Geodetic_Control/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=0&QUERY_LAYERS=0&STYLES=&BBOX=-8755946.244712,4269553.354533,-8752532.853668,4271036.710613&FEATURE_COUNT=10&HEIGHT=621&WIDTH=1429&FORMAT=png&INFO_FORMAT=application/vnd.ogc.wms_xml&SRS=EPSG:3857&X=745&Y=195
|
 |
Koen Aerts
Ranch Hand
Joined: Feb 07, 2012
Posts: 339
|
|
I'm not finding it. Works fine for me in Chrome, FF5 and FF10 as well as in IE.
In your web server work directory, what is on line 100 in proxy_jsp.java? Example of a tomcat work directory: /web/tomcat/work/Catalina/mywebapp/_/org/apache/jsp/ncomOL.
Just before the line where the Exception occurs, try and do a System.out.println or something similar to display the URL so we can see how it's formed.
|
 |
 |
|
|
subject: JSP Proxy File returning "malformed url" error
|
|
|