I try to establish a JDBC connection in my microservice to the Dremio DataHub but it ends up with error message CONNECTION : SSL negotiation failed
Here the steps I do.
-
I downloaded the JDBC driver from the website that are recommended. I used the newest version Index of jdbc-driver/25.0.0-202404051521110861-ed9515a8/. I put the file in a libs directory in my project root.
-
I add this driver to my pom.xml
<dependency>
<groupId>com.dremio</groupId>
<artifactId>dremio-jdbc-driver</artifactId>
<version>25.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar</systemPath>
</dependency>
- I put the following into my application.properties:
spring.datasource.url=jdbc:dremio:direct=datahub.emea.cumulocity.com:31010;ssl=true
spring.datasource.username=${C8Y_BOOTSTRAP_TENANT}/${DREMIO_USERNAME}
spring.datasource.password=${DREMIO_PASSWORD}
spring.datasource.driver-class-name=com.dremio.jdbc.Driver
-
I setup all enviroenment variables (I also check, all variables are set)
-
I try to check the connection
@Service
class DremioMeasurementService(@Autowired private val dataSource: DataSource) {
private val jdbcTemplate: JdbcTemplate = JdbcTemplate(dataSource)
@PostConstruct
fun init() {
try {
dataSource.connection.use { connection ->
println("Successfully connected to Dremio: ${connection.metaData.url}")
}
} catch (ex: Exception) {
println("Failed to connect to Dremio: ${ex.message}")
}
}
}
Have someone any idea what I do wrong or if I forgot something?
The stacktrace I got is this:
java.sql.SQLException: Failure in connecting to Dremio: cdjd.com.dremio.exec.rpc.ConnectionFailedException: CONNECTION : SSL negotiation failed
at com.dremio.jdbc.impl.DremioExceptionMapper.map(DremioExceptionMapper.java:73) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at com.dremio.jdbc.impl.DremioConnectionImpl.<init>(DremioConnectionImpl.java:102) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at com.dremio.jdbc.impl.DremioJdbc41Factory.newConnection(DremioJdbc41Factory.java:66) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at com.dremio.jdbc.impl.DremioFactory.newConnection(DremioFactory.java:61) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at com.dremio.jdbc.Driver.connect(Driver.java:76) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at com.example.microservices.dataintegration.measurment.adapter.dremio.DremioMeasurementService.init(DremioMeasurementService.kt:19) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.30.jar:5.3.30]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:921) ~[spring-context-5.3.30.jar:5.3.30]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.30.jar:5.3.30]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.17.jar:2.7.17]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-2.7.17.jar:2.7.17]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409) ~[spring-boot-2.7.17.jar:2.7.17]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.17.jar:2.7.17]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.7.17.jar:2.7.17]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289) ~[spring-boot-2.7.17.jar:2.7.17]
at com.example.microservices.dataintegration.DataIntegrationApplicationKt.main(DataIntegrationApplication.kt:13) ~[classes/:na]
at com.example.microservices.dataintegration.DataIntegrationApplicationKt.main(DataIntegrationApplication.kt) ~[classes/:na]
Caused by: cdjd.com.dremio.exec.rpc.ConnectionFailedException: CONNECTION : SSL negotiation failed
at cdjd.com.dremio.exec.rpc.ConnectionFailedException.mapException(ConnectionFailedException.java:29) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.exec.client.DremioClient$FutureHandler.connectionFailed(DremioClient.java:914) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.sabot.rpc.user.QueryResultHandler$ChannelClosedHandler.connectionFailed(QueryResultHandler.java:402) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.lambda$addNegotiator$0(BasicClient.java:383) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:557) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1985) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1955) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.handshake(SslHandler.java:2194) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.startHandshakeProcessing(SslHandler.java:2108) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.handlerAdded(SslHandler.java:2090) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1130) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:269) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.addNegotiator(BasicClient.java:395) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.operationComplete(BasicClient.java:327) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.operationComplete(BasicClient.java:303) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:301) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:336) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: cdjd.com.dremio.exec.rpc.RpcException: CONNECTION : SSL negotiation failed
at cdjd.com.dremio.exec.client.DremioClient$FutureHandler.connectionFailed(DremioClient.java:909) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
... 37 common frames omitted
Caused by: cdjd.com.dremio.exec.rpc.RpcException: SSL negotiation failed
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.lambda$addNegotiator$0(BasicClient.java:385) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
... 35 common frames omitted
Caused by: java.lang.UnsupportedOperationException: sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available
at cdjd.io.netty.util.internal.PlatformDependent.directBuffer(PlatformDependent.java:532) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.buffer.NettyArrowBuf.getDirectBuffer(NettyArrowBuf.java:267) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.buffer.NettyArrowBuf.internalNioBuffer(NettyArrowBuf.java:217) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.toByteBuffer(SslHandler.java:1606) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:1130) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:975) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
at cdjd.io.netty.handler.ssl.SslHandler.handshake(SslHandler.java:2192) ~[dremio-jdbc-driver-25.0.0-202404051521110861-ed9515a8.jar:25.0.0-202404051521110861-ed9515a8]
... 26 common frames omitted