Solved

eclipse derby error

Posted on 2013-12-31
4
1,626 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
tliotta earned 500 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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

622 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