alibaba / alibaba/DataX

Java调用ES的写插件报错

Open
#1,050 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

用源码编译了ES的写插件,放在dataX的工具包里面可以正常运行,但是放在Java项目里面会报错:
java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.copyOf(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;
at io.searchbox.client.AbstractJestClient$ServerPool.getServers(AbstractJestClient.java:114)
at io.searchbox.client.AbstractJestClient.setServers(AbstractJestClient.java:48)
at io.searchbox.client.JestClientFactory.getObject(JestClientFactory.java:60)
at com.alibaba.datax.plugin.writer.elasticsearchwriter.ESClient.createClient(ESClient.java:67)
at com.alibaba.datax.plugin.writer.elasticsearchwriter.ESWriter$Job.prepare(ESWriter.java:49)
at com.alibaba.datax.core.job.JobContainer.prepareJobWriter(JobContainer.java:724)
at com.alibaba.datax.core.job.JobContainer.prepare(JobContainer.java:309)
at com.alibaba.datax.core.job.JobContainer.start(JobContainer.java:115)
at com.alibaba.datax.core.Engine.start(Engine.java:92)
at com.alibaba.datax.core.Engine.entry(Engine.java:171)
at com.example.demo.DataXTestApplication.main(DataXTestApplication.java:18)
想问下这个报错原因是什么?怎么解决?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the stack trace at com.alibaba.datax.plugin.writer.elasticsearchwriter.ESClient.createClient and inspect the surrounding Elasticsearch writer setup, especially ESWriter.java and JestClientFactory.getObject. Reproduce the Java-project failure and compare its runtime dependency versions with the working DataX toolkit setup. Done means identifying the conflicting dependency and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.