Yes   I found setting these system properties works for URL  that live beyond the
company firewall e.g. http://java.sun.com

However
1) The settings cause the local company IP server addresses to fail.
2) System properties are global settings.  Setting the http.proxyHost
and http.proxyPort causes all URL to go throught the Http proxy.
3) There is no way creating java.net.URL that configured proxy connection
for proxy and another URL that configure for URL.
4) There is no standard Java method to say which host IP
are local intranet and those that are external.

--
Peter Pilgrim
G.O.A.T
                    "the Greatest Of All Time"



---------------------------------------- Message History 
----------------------------------------


From: "Marcus Nordlund (QRA)" <[EMAIL PROTECTED]>@java.sun.com> on 
30/04/2001 11:31 ZE2

Please respond to "A mailing list for discussion about Sun Microsystem's Java          
    Servlet API Technology." <[EMAIL PROTECTED]>

DELEGATED - Sent by:     "A mailing list for discussion about Sun Microsystem's Java   
           Servlet API Technology."@java.sun.com>


To:   [EMAIL PROTECTED]
cc:
Subject:  Re: URL in Servlets


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



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

___________________________________________________________________________
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

Reply via email to