Solved

eclipse derby error

Posted on 2013-12-31
4
1,590 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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

830 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