Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

eclipse derby error

Posted on 2013-12-31
4
Medium Priority
?
1,654 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 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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.  …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
The viewer will learn how to implement Singleton Design Pattern in Java.

704 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