Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7918

Unable to create MariaDB jdbc sink

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 2.6.2.Final, 2.7.0.Alpha2
    • jdbc-connector
    • None
    • False
    • None
    • False
    • Important

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      debezium-connector-jdbc-2.6.2.Final-plugin

      What is the connector configuration?

      {
          "name": "jdbc-connector",
          "config": {
              "connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
              "connection.username": <username>,
              "connection.password": <password>,
              "tasks.max": "1",
              "delete.enabled": "true",
              "auto.create": "true",
              "auto.evolve": "true",
              "connection.url": "jdbc:mariadb://<host>:<port>/<db>",
              "driver.class": "org.mariadb.jdbc.Driver",
              "primary.key.mode": "record_key",
              "topics":  "inventory.DEBEZIUM.CUSTOMERS",
              "schema.evolution": "basic",
              "insert.mode": "insert",
              "hibernate.c3p0.testConnectionOnCheckOut": "true"
          }
      }

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      MariaDB v11.1 in docker container running on Fedora 40

      What behaviour do you expect?

      Kafka connect should create the sink connector

      What behaviour do you see?

      i. Java SQLException: No suitable driver,  and ii. Hibernate is unable to determine Dialect without JDBC metadata.

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      Same issue with debezium-connector-jdbc-2.7.0.Alpha2-plugin

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      [2024-06-03 08:28:05,153] INFO 127.0.0.1 - - [03/Jun/2024:12:28:05 +0000] "POST /connectors HTTP/1.1" 201 600 "-" "insomnia/2023.5.8" 15 (org.apache.kafka.connect.runtime.rest.RestServer:62)
      [2024-06-03 08:28:05,153] INFO [jdbc-connector|task-0] Starting JdbcSinkConnectorConfig with configuration: (io.debezium.connector.jdbc.JdbcSinkConnectorTask:541)
      [2024-06-03 08:28:05,153] INFO [jdbc-connector|task-0]    connector.class = io.debezium.connector.jdbc.JdbcSinkConnector (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,153] INFO [jdbc-connector|task-0]    primary.key.mode = record_key (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,153] INFO [jdbc-connector|task-0]    connection.password = ******** (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,153] INFO [jdbc-connector|task-0]    topics = inventory.DEBEZIUM.CUSTOMERS (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    tasks.max = 1 (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    hibernate.c3p0.testConnectionOnCheckOut = true (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    connection.username = amrita (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    delete.enabled = true (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    schema.evolution = basic (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    auto.evolve = true (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    task.class = io.debezium.connector.jdbc.JdbcSinkConnectorTask (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    name = jdbc-connector (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    driver.class = org.mariadb.jdbc.Driver (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    auto.create = true (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    connection.url = jdbc:mariadb://localhost:3306/test (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,154] INFO [jdbc-connector|task-0]    insert.mode = insert (io.debezium.connector.jdbc.JdbcSinkConnectorTask:543)
      [2024-06-03 08:28:05,219] INFO [jdbc-connector|task-0] HHH000412: Hibernate ORM core version 6.2.18.Final (org.hibernate.Version:44)
      [2024-06-03 08:28:05,220] INFO [jdbc-connector|task-0] HHH000406: Using bytecode reflection optimizer (org.hibernate.cfg.Environment:191)
      [2024-06-03 08:28:05,275] INFO [jdbc-connector|task-0] HHH000130: Instantiating explicit connection provider: org.hibernate.c3p0.internal.C3P0ConnectionProvider (org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator:135)
      [2024-06-03 08:28:05,276] INFO [jdbc-connector|task-0] HHH010002: C3P0 using driver: null at URL: jdbc:mariadb://localhost:3306/test (org.hibernate.orm.connections.pooling.c3p0:124)
      [2024-06-03 08:28:05,277] INFO [jdbc-connector|task-0] HHH10001001: Connection properties: {password=****, user=amrita} (org.hibernate.orm.connections.pooling.c3p0:125)
      [2024-06-03 08:28:05,277] INFO [jdbc-connector|task-0] HHH10001003: Autocommit mode: false (org.hibernate.orm.connections.pooling.c3p0:128)
      [2024-06-03 08:28:05,277] WARN [jdbc-connector|task-0] HHH10001006: No JDBC Driver class was specified by property `jakarta.persistence.jdbc.driver`, `hibernate.driver` or `javax.persistence.jdbc.driver` (org.hibernate.orm.connections.pooling.c3p0:131)
      [2024-06-03 08:28:05,346] INFO [jdbc-connector|task-0] MLog clients using slf4j logging. (com.mchange.v2.log.MLog:212)
      [2024-06-03 08:28:05,408] INFO [jdbc-connector|task-0] Initializing c3p0-0.9.5.5 [built 11-December-2019 22:18:33 -0800; debug? true; trace: 10] (com.mchange.v2.c3p0.C3P0Registry:212)
      [2024-06-03 08:28:05,426] INFO [jdbc-connector|task-0] HHH10001007: JDBC isolation level: <unknown> (org.hibernate.orm.connections.pooling.c3p0:200)
      [2024-06-03 08:28:05,434] INFO [jdbc-connector|task-0] Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@34346f8a [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@98f8c1 [ acquireIncrement -> 32, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, identityToken -> 2so77ub31pm7eyo1hlul36|5d81403f, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 32, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@8eb69d5c [ description -> null, driverClass -> null, factoryClassLocation -> null, forceUseNamedDriverClass -> false, identityToken -> 2so77ub31pm7eyo1hlul36|27259b8c, jdbcUrl -> jdbc:mariadb://localhost:3306/test, properties -> {password=******, user=******} ], preferredTestQuery -> null, privilegeSpawnedThreads -> false, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, extensions -> {}, factoryClassLocation -> null, identityToken -> 2so77ub31pm7eyo1hlul36|64edbee3, numHelperThreads -> 3 ] (com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource:212)
      [2024-06-03 08:28:35,459] WARN [jdbc-connector|task-0] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@165c7544 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:  (com.mchange.v2.resourcepool.BasicResourcePool:223)
      java.sql.SQLException: No suitable driver
          at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:300)
          at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
          at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
          at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
          at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
          at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
          at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
          at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
          at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)
          at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
      [2024-06-03 08:28:35,460] WARN [jdbc-connector|task-0] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@55d74f5f is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. (com.mchange.v2.resourcepool.BasicResourcePool:220)
      [2024-06-03 08:28:35,462] WARN [jdbc-connector|task-0] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@43c9d99 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:  (com.mchange.v2.resourcepool.BasicResourcePool:223)
      java.sql.SQLException: No suitable driver
          at java.sql/java.sql.DriverManager.getDriver(DriverManager.java:300)
          at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
          at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
          at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
          at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
          at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
          at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)
          at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
          at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)
          at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
      [2024-06-03 08:28:35,463] WARN [jdbc-connector|task-0] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@55d74f5f is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. (com.mchange.v2.resourcepool.BasicResourcePool:220)
      [2024-06-03 08:28:35,468] WARN [jdbc-connector|task-0] HHH000342: Could not obtain connection to query metadata (org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator:378)
      java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)" because the return value of "org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()" is null
          at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:116)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.java:279)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:193)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:69)
          at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216)
          at org.hibernate.boot.model.relational.Database.<init>(Database.java:45)
          at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:231)
          at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:199)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:169)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:128)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:451)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:102)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:910)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:960)
          at io.debezium.connector.jdbc.JdbcSinkConnectorTask.start(JdbcSinkConnectorTask.java:75)
          at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:329)
          at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:202)
          at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:259)
          at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:237)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
          at java.base/java.lang.Thread.run(Thread.java:1583)
      [2024-06-03 08:28:35,469] ERROR [jdbc-connector|task-0] WorkerSinkTask{id=jdbc-connector-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:212)
      org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect')
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:277)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216)
          at org.hibernate.boot.model.relational.Database.<init>(Database.java:45)
          at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:231)
          at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:199)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:169)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:128)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:451)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:102)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:910)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:960)
          at io.debezium.connector.jdbc.JdbcSinkConnectorTask.start(JdbcSinkConnectorTask.java:75)
          at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:329)
          at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:202)
          at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:259)
          at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:237)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
          at java.base/java.lang.Thread.run(Thread.java:1583)
      Caused by: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect')
          at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:190)
          at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:86)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentWithDefaults(JdbcEnvironmentInitiator.java:229)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.java:381)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:193)
          at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:69)
          at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119)
          at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264)
          ... 21 more
       

      How to reproduce the issue using our tutorial deployment?

      <Your answer>

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

              Unassigned Unassigned
              amritaramnauth Amrita Ramnauth (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: