Cannot bootstrap Transport Client in version 5.4.0


(Animageofmine) #1

Following is the error I get. I don't know what am I missing. Like the stack trace mentions, the code fails here:

Some help would be super useful.

 registerAggregation(new AggregationSpec(PercentilesAggregationBuilder.NAME, PercentilesAggregationBuilder::new,
                PercentilesAggregationBuilder::parse)
                    .addResultReader(InternalTDigestPercentiles.NAME, InternalTDigestPercentiles::new)
                    .addResultReader(InternalHDRPercentiles.NAME, InternalHDRPercentiles::new));

Here is the stacktrace:

java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such constructor: org.elasticsearch.search.aggregations.metrics.percentiles.tdigest.InternalTDigestPercentiles.<init>(StreamInput)void/newInvokeSpecial
	at org.elasticsearch.search.SearchModule.registerAggregations(SearchModule.java:353)
	at org.elasticsearch.search.SearchModule.<init>(SearchModule.java:302)
	at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:142)
	at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:268)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:125)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:111)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:101)
	at com.sksamuel.elastic4s.TcpClientConstructors$class.transport(TcpClient.scala:104)
	at com.sksamuel.elastic4s.TcpClient$.transport(TcpClient.scala:112)
	at com.qualtrics.ae.api.model.ElasticsearchProfile$class.esClient(ElasticsearchProfile.scala:12)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsServiceModule$$anon$1.esClient$lzycompute(ElasticsearchFieldsetAnalyticsService.scala:315)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsServiceModule$$anon$1.esClient(ElasticsearchFieldsetAnalyticsService.scala:315)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsServiceModule$$anon$1.esClient(ElasticsearchFieldsetAnalyticsService.scala:315)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsService$class.aggregate(ElasticsearchFieldsetAnalyticsService.scala:58)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsServiceModule$$anon$1.aggregate(ElasticsearchFieldsetAnalyticsService.scala:315)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsService$$anonfun$aggregate$1$$anonfun$apply$1.apply(ElasticsearchFieldsetAnalyticsService.scala:45)
	at com.qualtrics.ae.api.model.ElasticsearchFieldsetAnalyticsService$$anonfun$aggregate$1$$anonfun$apply$1.apply(ElasticsearchFieldsetAnalyticsService.scala:43)
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.IllegalAccessError: no such constructor: org.elasticsearch.search.aggregations.metrics.percentiles.tdigest.InternalTDigestPercentiles.<init>(StreamInput)void/newInvokeSpecial
	at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:483)
	... 26 more
Caused by: java.lang.NoClassDefFoundError: com/tdunning/math/stats/TDigest
	at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
	at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
	at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
	at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1389)
	at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1745)
	at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
	... 26 more
Caused by: java.lang.ClassNotFoundException: com.tdunning.math.stats.TDigest
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 32 more
java.lang.BootstrapMethodError: java.lang.IllegalAccessError: 
	at org.elasticsearch.search.SearchModule.registerAggregations(SearchModule.java:353)
	at org.elasticsearch.search.SearchModule.<init>(SearchModule.java:302)
	at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:142)
	at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:268)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:125)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:111)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:101)
	at com.sksamuel.elastic4s.TcpClientConstructors$class.transport(TcpClient.scala:104)
	at com.sksamuel.elastic4s.TcpClient$.transport(TcpClient.scala:112)

(Peter Dyson) #2

Hi Animageofmine,

Are you using the official Java Transport Client?

There's an end-to-end example provided in a demo repo that might prove helpful.
(Also note this example uses X-Pack Security(shield) functionality that might have to be disabled/removed if you're not yet using X-Pack on your cluster.)


(Simon Willnauer) #3

do you have multiple version of elasticsearch / transport client in your classpath? It looks like it's picking up the wrong jar down the road.


(Animageofmine) #4

It definitely is some versioning or missing library issue. I verified that there is only one elasticsearch jar (org.elasticsearch:elasticsearch:5.4.0:jar) in my ivy cache.

I am using scala client elastic4s, which is a wrapper on top of java client. I know you guys don't guarantee anything outside of java client, so I won't blame you if you bail out. However, it does feel like a possible issue in the java client because we have been using scala client in production for a while without any issues.

If you need more information, I am happy to help. I am aware of the fact that I am one of the early adopters.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.