You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v0.7.2 java.lang.NullPointerException: Cannot invoke "java.lang.String.replaceAll(java.lang.String, java.lang.String)" because the return value of "java.lang.Package.getImplementationTitle()" is null
#2061
This code runs in Vertx worker verticle (which is VIRTUAL THREAD environment)
And I will see this stracetrack:
java.lang.ExceptionInInitializerError: null
at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:185) ~[?:?]
at com.shifudao.datahub.RouteBuilder.lambda$initLegacyRoutes$8(RouteBuilder.java:83) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.utils.RouteHelper.lambda$addQueryRoute$1(RouteHelper.java:89) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1281) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:145) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.handler.impl.LoggerHandlerImpl.handle(LoggerHandlerImpl.java:189) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.handler.impl.LoggerHandlerImpl.handle(LoggerHandlerImpl.java:48) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1281) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:145) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.route(RoutingContextImpl.java:94) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:69) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37) ~[datahub-ng-all.jar:?]
at io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:150) ~[datahub-ng-all.jar:?]
at io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:42) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:342) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ContextImpl.lambda$emit$8(ContextImpl.java:349) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.WorkerExecutor$1.execute(WorkerExecutor.java:70) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.WorkerTask.run(WorkerTask.java:56) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:81) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ThreadPerTaskExecutorService.lambda$execute$0(ThreadPerTaskExecutorService.java:82) ~[datahub-ng-all.jar:?]
at java.lang.VirtualThread.run(VirtualThread.java:335) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.String.replaceAll(java.lang.String, java.lang.String)" because the return value of "java.lang.Package.getImplementationTitle()" is null
at com.clickhouse.client.api.internal.HttpAPIClientHelper.buildDefaultUserAgent(HttpAPIClientHelper.java:691) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.internal.HttpAPIClientHelper.<init>(HttpAPIClientHelper.java:116) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client.<init>(Client.java:180) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client.<init>(Client.java:127) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client$Builder.build(Client.java:1068) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.services.DbService.<init>(DbService.java:25) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.queries.Query.<clinit>(Query.java:18) ~[datahub-ng-all.jar:?]
... 22 more
java.lang.ExceptionInInitializerError: null
at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:185) ~[?:?]
at com.shifudao.datahub.RouteBuilder.lambda$initLegacyRoutes$8(RouteBuilder.java:83) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.utils.RouteHelper.lambda$addQueryRoute$1(RouteHelper.java:89) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1281) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:145) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.handler.impl.LoggerHandlerImpl.handle(LoggerHandlerImpl.java:189) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.handler.impl.LoggerHandlerImpl.handle(LoggerHandlerImpl.java:48) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1281) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:145) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RoutingContextImpl.route(RoutingContextImpl.java:94) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:69) ~[datahub-ng-all.jar:?]
at io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37) ~[datahub-ng-all.jar:?]
at io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:150) ~[datahub-ng-all.jar:?]
at io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:42) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:342) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ContextImpl.lambda$emit$8(ContextImpl.java:349) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.WorkerExecutor$1.execute(WorkerExecutor.java:70) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.WorkerTask.run(WorkerTask.java:56) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:81) ~[datahub-ng-all.jar:?]
at io.vertx.core.impl.ThreadPerTaskExecutorService.lambda$execute$0(ThreadPerTaskExecutorService.java:82) ~[datahub-ng-all.jar:?]
at java.lang.VirtualThread.run(VirtualThread.java:335) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.String.replaceAll(java.lang.String, java.lang.String)" because the return value of "java.lang.Package.getImplementationTitle()" is null
at com.clickhouse.client.api.internal.HttpAPIClientHelper.buildDefaultUserAgent(HttpAPIClientHelper.java:691) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.internal.HttpAPIClientHelper.<init>(HttpAPIClientHelper.java:116) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client.<init>(Client.java:180) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client.<init>(Client.java:127) ~[datahub-ng-all.jar:?]
at com.clickhouse.client.api.Client$Builder.build(Client.java:1068) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.services.DbService.<init>(DbService.java:25) ~[datahub-ng-all.jar:?]
at com.shifudao.datahub.queries.Query.<clinit>(Query.java:18) ~[datahub-ng-all.jar:?]
... 22 more
Configuration
Environment
Client version: 0.7.2
Language version: Java 21 LTS
OS: Archlinux
The text was updated successfully, but these errors were encountered:
abcfy2
changed the title
java.lang.NullPointerException: Cannot invoke "java.lang.String.replaceAll(java.lang.String, java.lang.String)" because the return value of "java.lang.Package.getImplementationTitle()" is null
v0.7.2 java.lang.NullPointerException: Cannot invoke "java.lang.String.replaceAll(java.lang.String, java.lang.String)" because the return value of "java.lang.Package.getImplementationTitle()" is null
Jan 1, 2025
I find the reason. shadow plugin will bundle all the dependencies into one fat jar, so MANIFEST file will not contains Implementation-Title and Implementation-Version in fat jar.
As a quick and dirty sulotion, I have to add a FAKEImplementation-Title to my fat jar:
tasks.withType<ShadowJar> {
archiveClassifier.set("all")
archiveVersion.set("")
manifest {
attributes(
mapOf(
"Implementation-Title" to "ClickHouse Client API",
"Implementation-Version" to "client-v2 $clickhouseClientV2Version",
// other attributes
)
)
}
mergeServiceFiles()
}
However I think the library should provide the setters or functions to allow the user to set both "Implementation-title" and "Implementation-version" manually.
Good day, @grant-guo!
Thank you for the hint!
Library provides setClientName() what is more DB specific.
We are using getImplementationTitle just to get version of http client that is used.
We've moved from this in the library itself and using version from a file. But for the client we do not have such possibility because dependency may be user defined.
Describe the bug
This is the new BUG only in
0.7.2
, but0.7.1
is working very well.I have this code in my project:
This code runs in Vertx worker verticle (which is VIRTUAL THREAD environment)
And I will see this stracetrack:
The NPE is from
clickhouse-java/client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java
Line 691 in 33b1fad
Error log
Configuration
Environment
The text was updated successfully, but these errors were encountered: