André Alves André Alves - 1 year ago 216
Java Question

NoSuchMethodError: conflits on Elastic Search jar

While creating Elasticsearch Client, I'm getting the exception java.lang.NoSuchMethodError:;
After some lookup, seams like the Guava-18 is being overwrite by an older version at runtime, and Guava-18 only works during compile task.

My Maven configuration is the follow:

<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>

How can i force the Guava-18 version at execution time?

Answer Source

You should try to find where the "old" version of guava is taken from and to exclude it once for all.

Find the dependency :

mvn dependency:tree | grep guava

Exclude it :


See for more info on the dependency exclusion.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download