• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Proxy File returning "malformed url" error  RSS feed

 
Brett Spivey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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)
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Okay, thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for the reply. However, that isn't it.
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • 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
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!