java.sql.SQLNonTransientConnectionException

java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.

Samebug tips4

Check if your MongoDB is available.


Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web250

  • via Google Groups by Unknown author, 6 months ago
    java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
  • java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
  • via Coderanch by sanket jani, 7 months ago
    java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
  • Stack trace

    • java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused. 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 java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361) at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416) at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120) at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:483) at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:296) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:211) at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:271) at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 10 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 1 year ago
    Unknown user
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    114 times, 1 year ago
    Unknown user
    Once, 1 year ago
    280 more bugmates