Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not initialize class okhttp3.CacheControl #275

Open
mpreethi-webmd opened this issue Sep 24, 2024 · 1 comment
Open

Could not initialize class okhttp3.CacheControl #275

mpreethi-webmd opened this issue Sep 24, 2024 · 1 comment

Comments

@mpreethi-webmd
Copy link

While using DatabendDriver, databend-jdbc it attempts to make a connection and fails with the below error
java.lang.NoClassDefFoundError: Could not initialize class okhttp3.CacheControl at okhttp3.Request.cacheControl(Request.kt:116) at okhttp3.internal.cache.CacheStrategy$Factory.compute(CacheStrategy.kt:134) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:52) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.databend.client.OkHttpUtils.lambda$basicAuthInterceptor$1(OkHttpUtils.java:43) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.databend.client.OkHttpUtils.lambda$userAgentInterceptor$0(OkHttpUtils.java:39) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205) at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158) at com.databend.client.JsonResponse.execute(JsonResponse.java:63) at com.databend.client.DatabendClientV1.executeInternal(DatabendClientV1.java:249) at com.databend.client.DatabendClientV1.execute(DatabendClientV1.java:298) at com.databend.client.DatabendClientV1.<init>(DatabendClientV1.java:91) at com.databend.jdbc.DatabendConnection.startQueryWithFailover(DatabendConnection.java:729) at com.databend.jdbc.DatabendConnection.startQuery(DatabendConnection.java:766) at com.databend.jdbc.DatabendConnection.setSchema(DatabendConnection.java:562) at com.databend.jdbc.DatabendConnection.<init>(DatabendConnection.java:111) at com.databend.jdbc.NonRegisteringDatabendDriver.connect(NonRegisteringDatabendDriver.java:60)

In the pom.xml file in databend-jdbc and databend-client it was noticed that <dep.okhttp.version>5.0.0-alpha.11</dep.okhttp.version> which doesnt seem to have the class but when we use <dep.okhttp.version>4.9.3</dep.okhttp.version> it has all the classes.
Could you please help with this issue?
Thanks in advance

@ZhiHanZ
Copy link
Collaborator

ZhiHanZ commented Sep 25, 2024

Hi @mpreethi-webmd , old Okhttp has some hang issues and suggested us to upgrade to the given version(5.0.0-alpha.11), #61, does upgrade make sense to your application?

Plus, could you take a trial on our 0.3.2-rc1 version which removed some maven shade and may resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants