Nexus
Nexus

Reputation: 65

mockserver not compatible with the last version of google guava

Currently I use mockServer to mock all the external services in Java. When I start mockServer :

mockServer = startClientAndServer(1080);
proxy = StartClientAndProxy(1090);

I receive

NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet().

After a bit of research, I think error occur because of the last version of the google guava-libraries and more precisely the function com.google.common.collect.Sets.newConcurrentHashSet() which does not exist anymore is the last version of guava.

Unfortunately, I have another lib which require the last version of guava.

What would you recommend to fix the issue?

Upvotes: 0

Views: 335

Answers (1)

Olivier Grégoire
Olivier Grégoire

Reputation: 35477

It looks to me that Sets.newConcurrentHashSet() pretty much still exists in the latest snapshot version of Guava. It was added in Release 15. MockServer requires Guava 18.

My guess is that you have an older version of Guava on the classpath from another dependency. Find which one and adapt it.

Upvotes: 1

Related Questions