If you connect through a proxy you need to set properties indicating
where this can be found:
http.proxyHost = 'proxy-host-name'
http.proxyPort = 'proxy-port-#'
Hope this helps!
/
M
Have you set the
> -----Original Message-----
> From: Shahzad Mahmood [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 28, 2001 11:47
> To: [EMAIL PROTECTED]
> Subject: URL in Servlets
>
>
> Hi,
>
> I m trying to open a URLConnection with an external resource
> (xyz.com) within
> the servlet code but it is providing me the following exception.
>
> java.net.ConnectException: Connection refused: no further information
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
> at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
> at java.net.Socket.<init>(Socket.java:273)
> at java.net.Socket.<init>(Socket.java:100)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
> at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
> at sun.net.www.http.HttpClient.<init>(HttpClient.java:277)
> at sun.net.www.http.HttpClient.New(HttpClient.java:289)
> at
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
> .java:379)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
> nection.java:472)
> at java.net.URL.openStream(URL.java:798)
> at
> examples.jsp.cal.Calurl_jsp_2._jspService(Calurl_jsp_2.java:78)
> at
> com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> at
> com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.j
> ava:88)
> at
> com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:218)
> at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:294)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> at
> com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155
> )
> at com.sun.web.core.Context.handleRequest(Context.java:414)
> at
> com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
> HANDLER THREAD PROBLEM: java.io.IOException: Socket Closed
> java.io.IOException: Socket Closed
> at
> java.net.PlainSocketImpl.getInputStream(PlainSocketImpl.java:421)
> at java.net.Socket$1.run(Socket.java:335)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.Socket.getInputStream(Socket.java:332)
> at
> com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
>
> Can anybody help me
>
> shahzad
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html