ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.45k stars 535 forks source link

[JDBC] java.lang.NoClassDefFoundError: com/clickhouse/client/internal/apache/hc/core5/http2/HttpVersionPolicy #1912

Closed ivan-klass closed 1 week ago

ivan-klass commented 1 week ago

Describe the bug

NoClassDefFoundError

Steps to reproduce

I've updated from 0.6.5 to version 0.7.1. I'm using "shaded" jar - so I expect not to care about any other thirdparty libraries. The jar is "runtime" dependency, not used by compiler.

Expected behaviour

Works as before

Error log

java.lang.NoClassDefFoundError: com/clickhouse/client/internal/apache/hc/core5/http2/HttpVersionPolicy
    at com.clickhouse.client.internal.apache.hc.client5.http.config.TlsConfig$Builder.build(TlsConfig.java:211)
    at com.clickhouse.client.internal.apache.hc.client5.http.config.TlsConfig.<clinit>(TlsConfig.java:47)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.resolveTlsConfig(PoolingHttpClientConnectionManager.java:276)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:441)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:115)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
    at com.clickhouse.client.internal.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:123)
    at com.clickhouse.client.http.ApacheHttpConnectionImpl.post(ApacheHttpConnectionImpl.java:280)
    at com.clickhouse.client.http.ClickHouseHttpClient.send(ClickHouseHttpClient.java:195)
    at com.clickhouse.client.AbstractClient.execute(AbstractClient.java:280)
    at com.clickhouse.client.ClickHouseClientBuilder$Agent.sendOnce(ClickHouseClientBuilder.java:282)
    at com.clickhouse.client.ClickHouseClientBuilder$Agent.send(ClickHouseClientBuilder.java:294)
    at com.clickhouse.client.ClickHouseClientBuilder$Agent.execute(ClickHouseClientBuilder.java:349)
    at com.clickhouse.client.ClickHouseClient.executeAndWait(ClickHouseClient.java:881)
    at com.clickhouse.client.ClickHouseRequest.executeAndWait(ClickHouseRequest.java:2154)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.getServerInfo(ClickHouseConnectionImpl.java:128)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.<init>(ClickHouseConnectionImpl.java:339)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.<init>(ClickHouseConnectionImpl.java:288)
    at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:175)
    at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:34)
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:137)
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:360)
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202)
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:461)
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:550)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:98)
    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)

Configuration

Environment

amazoncorretto:21-alpine docker image java Scala 3.5.2, doobie + Hikari pool

chernser commented 1 week ago

@ivan-klass thank you for reporting! Will be fixed in the patch this week.

chernser commented 1 week ago

@ivan-klass new version with fix is release (0.7.1-patch). It should be soon be in Maven central.