Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HttpProxy - Tried to proxy to unknown host

    I am playing with the WSDL web service example from the downloaded ShowcaseEE project. I created my own small project to just have this particular example. Everything works fine at home but when I ran it from enterprise intranet, which has its own http proxy to access outside web sites, I encountered error shown as below. Any idea how to fix it to make the HttpProxy work with enterprise http proxy? Thanks. BTw, I am using EE version 2.1

    === 2010-06-03 11:57:25,608 [l0-2] DEBUG HttpProxyServlet - HttpProxy - ProxyData is: {
    xsi:"http://www.w3.org/2000/10/XMLSchema-instance",
    url:"http://www.webservicex.net/uszip.asmx?WSDL",
    httpMethod:"GET"
    }
    === 2010-06-03 11:57:25,686 [l0-2] WARN HttpProxyServlet - HttpProxy - Tried to proxy to unknown host, returning error
    java.net.UnknownHostException: www.webservicex.net
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at com.isomorphic.servlet.HttpProxyServlet.doPost(HttpProxyServlet.java:521)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

    #2
    See the JavaDoc for HttpProxyServlet.setProxyHost(). Like other properties on servlets in general, this can be set via <init-param> in web.xml where the <servlet> is defined.

    Comment


      #3
      Originally posted by Isomorphic
      See the JavaDoc for HttpProxyServlet.setProxyHost(). Like other properties on servlets in general, this can be set via <init-param> in web.xml where the <servlet> is defined.

      I tried setting the <init-param> but it did not solve the problem. Here is the seting in my web.xml

      <servlet>
      <servlet-name>HttpProxy</servlet-name>
      <servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
      <init-param>
      <param-name>ProxyHost</param-name>
      <param-value>myproxyhost</param-value>
      </init-param>
      <init-param>
      <param-name>ProxyPort</param-name>
      <param-value>myproxyport</param-value>
      </init-param>
      </servlet>

      Comment


        #4
        Should be leading lowercase (proxyHost) like the Java beans naming convention.

        Comment

        Working...
        X