• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JSP Proxy File returning "malformed url" error

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Sheriff
Posts: 28344
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, thanks.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this perhaps the culprit:

"http://http://imagery.nconemap.com/ArcGIS/rest/services/"

Notice how http:// is repeated in there...
 
Brett Spivey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. However, that isn't it.
 
Koen Aerts
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Koen Aerts
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Brett Spivey wrote: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


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.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic