Solved

eclipse derby error

Posted on 2013-12-31
4
1,571 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 500 total points
Comment Utility
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
Comment Utility
Got you. Let me double check
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now