You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/08/23 14:37:17 UTC
DO NOT REPLY [Bug 49806] java.net.ConnectException when attempting
to open URL via Java code
https://issues.apache.org/bugzilla/show_bug.cgi?id=49806
--- Comment #1 from Wesley <we...@gmail.com> 2010-08-23 08:37:12 EDT ---
(In reply to comment #0)
> The following piece of code generates a "java.net.ConnectException: Connection
> refused: connect" error :
>
> URL url = new URL("http://localhost:8080/myapp/mypage.jsp");
> url.openStream();
>
> It crashes with Tomcat 5.5.30 but it works with Tomcat 5.5.28.
>
> The Tomcat server is started and the HTTP link works in my web browser.
>
> The full error stack is :
> Exception in thread "main" java.net.ConnectException: Connection refused:
> connect
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> ...
This isn't tomcat code its directly from the java.net package.
The error message means what it says and a connection was refused. Is that the
error? You need to have port 8080 open and accepting connections from localhost
for this error not to occur.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org