Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-646

NullPointerException when connection lost to database

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.0, 2.2.6
    • Fix Version/s: 2.4.0, 1.8.0
    • Component/s: Failover
    • Labels:
      None
    • Environment:
      Debian 9 and Mac OS X 10.13.6

      Description

      When a connection is lost to the database (MySQL Server) and the driver is used with aurora capabilities a NullPointerException is thrown and a connection can't be established anymore, without restarting the app...

      Connection URL: jdbc:mariadb:aurora://192.168.1.2:3307/mysaas?characterEncoding=UTF-8&useOldAliasMetadataBehavior=true

      The stacktrace is :

      DEBUG HikariPool:487 - mysaas_main_datasource - Cannot acquire connection from data source
      java.lang.NullPointerException
      	at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.setHostAddress(AbstractConnectProtocol.java:1235)
      	at org.mariadb.jdbc.internal.protocol.AuroraProtocol.loop(AuroraProtocol.java:166)
      	at org.mariadb.jdbc.internal.failover.impl.AuroraListener.reconnectFailedConnection(AuroraListener.java:206)
      	at org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener.initializeConnection(MastersSlavesListener.java:170)
      	at org.mariadb.jdbc.internal.failover.FailoverProxy.<init>(FailoverProxy.java:115)
      	at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:542)
      	at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:174)
      	at org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:288)
      	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
      	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
      	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
      	at com.zaxxer.hikari.pool.HikariPool.access$100(HikariPool.java:71)
      	at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:706)
      	at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:692)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:844)
      

      Attached a log of the error.

        Attachments

          Activity

            People

            • Assignee:
              diego dupin Diego Dupin
              Reporter:
              aleroot Alessio Pollero
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: