🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
4 messages
4 total messages Started by Tony F. White Fri, 07 Jan 2000 00:00
Connection Refused??
#1010
Author: Tony F. White
Date: Fri, 07 Jan 2000 00:00
17 lines
1370 bytes
Does anyone have any idea why the following code would work for
http://localhost/jserv/index.html
but not
http://www.java.sun.com/index.html

        URL inputUrl = new URL(input.trim()); /*where input is a string
containing a http: address */
        InputStream inputStream = inputUrl.openStream();

the code throws the following exception:
        java.net.ConnectException: Connection refused: no further
information


I have tried using the longer version of openstream and it throws the
exception when it trys to get the inputstream
(Note the code is part of a servlet)
Re: Connection Refused??
#1008
Author: Peter van der Linden
Date: Thu, 06 Jan 2000 00:00
16 lines
1074 bytes
In article <3873f65d_2@news.ausmail.com>,
Tony F. White <tony@worldlingo.com> wrote:
>Does anyone have any idea why the following code would work for
>http://localhost/jserv/index.html
>but not
>http://www.java.sun.com/index.html

Does your company have a firewall that needs a proxy?  That might
be one possibility.

You can find a bit of helpful info on this in the Java FAQ.

The Java FAQ is at   
                        http://www.afu.com

Might be worth bookmarking it, or looking thru it for other info.
Re: Connection Refused??
#1011
Author: iccucima
Date: Fri, 07 Jan 2000 00:00
60 lines
2567 bytes
Hi,
(perhaps you can help me.)
I'm a beginner and have a similar problem. When I try to open a
connection from the company intranet, I have a FileNotFoundException;
when I use
java -Dhttp.proxyHost=proxyhost
    [-Dhttp.proxyPort=portNumber] download_url
the program simply terminates immediately.

Note. I can use a browser, but not TeleportPro (??).

This is the code:


import java.net.*;
import java.io.*;


public class download_url {
    public static void main(String[] args) throws Exception {

      String base = new String( args[0] ), inputLine;
      URL yahoo = new URL( base );
      BufferedReader in = new BufferedReader(
				new InputStreamReader(
				yahoo.openStream()));
	while ((inputLine = in.readLine()) != null)
		System.out.println( inputLine );
	in.close();
	}
}

In article <3873f65d_2@news.ausmail.com>,
  "Tony F. White" <tony@worldlingo.com> wrote:
> Does anyone have any idea why the following code would work for
> http://localhost/jserv/index.html
> but not
> http://www.java.sun.com/index.html
>
>         URL inputUrl = new URL(input.trim()); /*where input is a
string
> containing a http: address */
>         InputStream inputStream = inputUrl.openStream();
>
> the code throws the following exception:
>         java.net.ConnectException: Connection refused: no further
> information
>
> I have tried using the longer version of openstream and it throws the
> exception when it trys to get the inputstream
> (Note the code is part of a servlet)
>
>

Thanks in advance,
Andrea


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: Connection Refused??
#1012
Author: Tony F. White
Date: Fri, 07 Jan 2000 00:00
35 lines
1953 bytes
Thanks for the Info
that does seem to be the problem because with further testing we were able
to ascertain that
we can access webpages within the intranet.
But unfortunately still we are unable to access the outside web even using

    // set up to use proxy
    System.getProperties().put("http.proxySet", "true");
    System.getProperties().put("http.proxyHost", proxyHost);
    System.getProperties().put("http.proxyPort", proxyPort);

We are still getting the same exception as before
(java.net.ConnectException: Connection refused: )

if you have any other sugestions as to why this might be so we would be
happy to hear them

Peter van der Linden <pvdl@best.com> wrote in message
news:3873fe52$0$216@nntp1.ba.best.com...
> In article <3873f65d_2@news.ausmail.com>,
> Tony F. White <tony@worldlingo.com> wrote:
> >Does anyone have any idea why the following code would work for
> >http://localhost/jserv/index.html
> >but not
> >http://www.java.sun.com/index.html
>
> Does your company have a firewall that needs a proxy?  That might
> be one possibility.
>
> You can find a bit of helpful info on this in the Java FAQ.
>
> The Java FAQ is at
>                         http://www.afu.com
>
> Might be worth bookmarking it, or looking thru it for other info.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads