Recently while merging in some new unit tests into my working branch, I started seeing this error:
Exception (java.lang.NoSuchMethodError) encountered during startup: com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService()Lcom/google/common/util/concurrent/ListeningExecutorService;
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService()Lcom/google/common/util/concurrent/ListeningExecutorService;
at org.apache.cassandra.index.SecondaryIndexManager.<clinit>(SecondaryIndexManager.java:125)
at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:405)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:623)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:597)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:588)
at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:417)
at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:324)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:129)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:106)
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:935)
at org.apache.cassandra.service.StartupChecks$10.execute(StartupChecks.java:422)
at org.apache.cassandra.service.StartupChecks.verify(StartupChecks.java:125)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:200)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:602)
at org.cassandraunit.utils.EmbeddedCassandraServerHelper.lambda$startEmbeddedCassandra$1(EmbeddedCassandraServerHelper.java:150)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Here's the offending test class:
@RunWith(SpringRunner.class)
@SpringBootTest(classes = { MyApplication.class })
@TestExecutionListeners(listeners = { CassandraUnitDependencyInjectionTestExecutionListener.class, DependencyInjectionTestExecutionListener.class })
@EmbeddedCassandra(timeout = 100000)
@CassandraDataSet("indexer.cql")
@ActiveProfiles("test")
public class MyDaoTest {
@Autowired
MyDao myDao;
@Test ...
}
I was able to verify that the unit tests pass as written by running mvn test -DskipMutation
, so this appears to be an issue when using embedded Cassandra in conjunction with mutation tests, but I'm not very familiar with either of these technologies.
Has anyone ever run into this issue before, and could you provide some pointers on resolving this issue (without simply disabling mutation tests)?