1

I am getting the following error:

[error] ignite - Got exception while starting (will rollback startup routine).
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService;
    at org.apache.curator.framework.listen.ListenerContainer.addListener(ListenerContainer.java:40)
    at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:256)
    at org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder.init(TcpDiscoveryZookeeperIpFinder.java:147)
    at org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder.registerAddresses(TcpDiscoveryZookeeperIpFinder.java:206)
    at org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter.initializeLocalAddresses(TcpDiscoveryIpFinderAdapter.java:61)
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoveryImpl.registerLocalNodeAddress(TcpDiscoveryImpl.java:317)
    at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:343)
    at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:1846)
    at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:297)
    at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:882)

The project uses the Play Framework which depends on Guava 22.0 with Apache Ignite but the latest Apache Ignite version depends on Guava 16.0. I am using SBT, so Guava 16.0 is being evicted in favor of Guava 22.0. I am wondering, is there another way to resolve the dependency conflict so that ignite uses Guava 16.0 while the rest of the project uses Guava 22.0.

My current idea is to separate the Apache Ignite into a separate submodule and to use sbt-assembly to shade the guava 16 dependency into an unmanaged jar.

Stanislav Lukyanov
  • 2,147
  • 10
  • 20

2 Answers2

1

before shading the jar, try forcing the guava version to be 16.0, and see if play is compatible with that version.

to force a specific version, add to your build.sbt:

dependencyOverrides += "com.google.guava" % "guava" % "16.0"
lev
  • 3,986
  • 4
  • 33
  • 46
0

The answer was to create a new sub-project inside the main one, where to store the Apache Ignite dependencies.The sub-project must be assembled to jar file with the shaded Guava dependency. Finally, to say on the main project that it depends on the previously created jar file.