Questions tagged [connectexception]

77 questions
93
votes
10 answers

Why would a "java.net.ConnectException: Connection timed out" exception occur when URL is up?

I'm getting a ConnectException: Connection timed out with some frequency from my code. The URL I am trying to hit is up. The same code works for some users, but not others. It seems like once one user starts to get this exception they continue to…
Sarah Haskins
  • 931
  • 1
  • 8
  • 3
63
votes
16 answers

Hadoop cluster setup - java.net.ConnectException: Connection refused

I want to setup a hadoop-cluster in pseudo-distributed mode. I managed to perform all the setup-steps, including startuping a Namenode, Datanode, Jobtracker and a Tasktracker on my machine. Then I tried to run some exemplary programms and faced the…
Marta Karas
  • 4,967
  • 10
  • 47
  • 77
5
votes
4 answers

CommunicationException [Root exception is ConnectException: Connection timed out]

I'm getting this exception occasionally, while trying to connect Active Directory. javax.naming.CommunicationException: : [Root exception is java.net.ConnectException: Connection timed out: connect] Here is my code: …
4
votes
5 answers

cassandra nodetool : Failed to connect to '127.0.0.1:7199'

i installed cassandra 3.11.3-1 on centos7 & vmware i didn't have error while installing cassandra. i started cassandra and faced this logs. [root@localhost ~]# service cassandra start Starting cassandra (via systemctl): [ …
woojin park
  • 41
  • 1
  • 1
  • 5
4
votes
5 answers

Cassandra on Docker - nodetool connection issue

I was given a R&D task on running Cassandra on Docker. I'm working on XUbuntu 14.04.2 64 bit (installed on VirtualBOX in Windows7 32 bit OS). I was following the steps given in Docker on Ubuntu and Pokle cassandra tutorials and I got a…
Asela
  • 117
  • 1
  • 3
  • 12
4
votes
2 answers

I have a ConnectException that isn't being caught for some reason

I'm working on an Android application that uses sockets. I have a function called initializeStreams() which opens the socket and attempts a connection. This function throws a ConnectException if the connection could not be established. But for some…
aakbari1024
  • 167
  • 1
  • 3
  • 9
3
votes
2 answers

Java TCP socket: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

I am creating socket using socket = new Socket(host, port, InetAddress.getLocalHost(), clientPort);. I want the socket to listen to particular port at client side. But when I use InetAddress.getLocalHost() I get java.net.ConnectException: connect:…
Android_enthusiast
  • 863
  • 5
  • 22
  • 41
3
votes
1 answer

Why there are differences in the exception In socket connection on Windows platform

On Windows platform, I run this code: code: Socket socket = new Socket(); try { socket.connect(new InetSocketAddress("127.0.0.1", 8080), 500); } catch (Exception e) { e.printStackTrace(); } socket = new Socket(); …
3
votes
0 answers

java.net.ConnectException: Connection timed out: connect when we download java client application from Java web Start

Our Java Client Appllication(Java Swing Application) is downloaded by java web start.At that time its throw following exception. I have following questions. What is reason for this exception? is this because of client code or Firewall(windows and…
3
votes
1 answer

Oracle JDBC Connection refused (only from jdbc code)

I'm getting Connection refused when I try to connect to a remote Oracle database. I can successfully telnet to the same IP address and port and I can even connect via SQL Developer or IntelliJ Idea's Database tab using the same credentials, but when…
Victor Basso
  • 5,556
  • 5
  • 42
  • 60
3
votes
1 answer

Java RMI To use SecurityManager or not to use SecurityManager

After significant searching and trial and error, I still can not determine if a Security Manager is necessary and if so, how to make it work. Code to start server: Registry registry; try { …
KSK
  • 149
  • 3
  • 15
3
votes
4 answers

JavaMail - Setting up ports, proxy and firewall

I'm trying to make a very simple E-Mail application, and I have written a few lines of basic code. One exception I keep getting is com.sun.mail.util.MailConnectException. Is there a simple way to code my way through a proxy or a firewall without…
DoTheGenes
  • 197
  • 2
  • 4
  • 22
3
votes
1 answer

Java delay before throwing ConnectException

I'm writing some code in Java to dowload stuff from urls and in my configuration some downloads should be handled by a proxy and others without it. So I wrote this code (it works) to download all URL types but and I'd like to reduce the delay time…
Jerome
  • 1,225
  • 2
  • 12
  • 23
3
votes
5 answers

HttpsURLConnection: Connection Timed out error

I have a simple code for setting up a https connection to google and printing the response obtained. import java.io.OutputStreamWriter; import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class SendCertReq { public static void…
DanMatlin
  • 1,212
  • 7
  • 19
  • 37
3
votes
2 answers

JUnit java.net.ConnectException

I'm pretty new in Java, so don't be rude ;-) I got a task to do and there are some JUnit-Tests to verify my solution. When I'm trying to run them, it takes some time and then I get the following errors: Could not connect to: : 51219 …
Matteo
  • 31
  • 2
1
2 3 4 5 6