Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

eclipse derby error

Posted on 2013-12-31
4
Medium Priority
?
1,681 Views
Last Modified: 2014-01-21
When configuring derby from eclipse when i click test connection getting below error saying Ping failed with error details.

java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error

connecting to server localhost on port 5555 with message Connection refused:

connect.
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown

Source)
      at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
      at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
      at

org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection

(JDBCConnection.java:214)
      at

org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyEmbeddedJDB

CConnection.createConnection(DerbyEmbeddedJDBCConnection.java:137)
      at

org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection

(DriverConnectionBase.java:105)
      at org.eclipse.datatools.connectivity.DriverConnectionBase.open

(DriverConnectionBase.java:54)
      at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open

(JDBCConnection.java:73)
      at

org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyJDBCConnect

ionFactory.createConnection(DerbyJDBCConnectionFactory.java:32)
      at

org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnecti

on(ConnectionFactoryProvider.java:83)
      at

org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection

(ConnectionProfile.java:359)
      at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection

(PingJob.java:76)
      at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException

: Error connecting to server localhost on port 5555 with message Connection refused:

connect.
      at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
      at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
      at org.apache.derby.client.am.Connection.<init>(Unknown Source)
      at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
      at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
      at

org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown

Source)
      ... 12 more
Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.DualStackPlainSocketImpl.connect0(Native Method)
      at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
      at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      ... 18 more

Can you please let me know how to resolve it. I tried changing port to 5555 still did not help


URL and driver name are
jdbc:derby://localhost:5555/sample;create=true
 
org.apache.derby.jdbc.ClientDriver

please advise
Any links resources ideas highly appreciated. Thanks in advance
DerbyErr.jpg
0
Comment
Question by:gudii9
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
tliotta earned 2000 total points
ID: 39749452
connecting to server localhost on port 5555 with message Connection refused:

"Connection refused" commonly indicates either a firewall block or a port that isn't open. The connection wasn't 'rejected'; it was 'refused'. That is, you didn't manage to get through to anything that could decide whether the connection could be accepted or rejected. Instead, the connection was simply ignored, as far as can be determined. (Technically, it might have gotten through to make contact, and it was any acknowledgement that wasn't allowed to make it back. Regardless, your client is unaware of any working connection.)

Since it's 'localhost', are you running a software firewall? Also, have you started an instance of the database and is it listening for connection requests on the designated port?

Tom
0
 
LVL 7

Author Comment

by:gudii9
ID: 39752102
Got you. Let me double check
0
 
LVL 7

Author Comment

by:gudii9
ID: 39797821
oh i realize i did not start server ..I went inside

C:\software\db-derby-10.6.1.0-bin\db-derby-10.6.1.0-bin\bin
startNetworkSerer

After that ping also successful.

i kept 1527 itself as attached.
DerbyErr2.jpg
0
 
LVL 27

Expert Comment

by:tliotta
ID: 39798690
Very good. Happy it's working.

In the future, keep in mind that "connection rejected" and "connection refused" is often a useful clue. "Rejected" often means that the request was examined and not allowed, perhaps due to authority or a disallowed source address. "Refused" often means that the port is effectively ignoring the request, like it has simply turned its back to all requests, often because a service isn't started or the path is blocked.

I could swear that I've seen those reversed in some clients, but I don't have any examples. I just start my analysis with the assumption that the meanings are as I wrote. It almost always saves time.

Tom
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question