NoSuchMethodError using cassandra-unit

80 views
Skip to first unread message

Wim Deblauwe

unread,
Jun 11, 2014, 8:31:17 AM6/11/14
to spring-dat...@googlegroups.com
Hi,

I am trying to write a unit test for my code that uses CassandraTemplate. Since I use TestNG, I have to manually start embedded cassandra by using this construct (from cassandra-unit):

        @BeforeClass
public void startCassandra() throws InterruptedException, TTransportException, ConfigurationException, IOException
{
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
}

@BeforeMethod
public void cleanCassandra() throws InterruptedException, TTransportException, ConfigurationException, IOException
{
EmbeddedCassandraServerHelper.cleanEmbeddedCassandra();
}

However, I get this exception during startup:

2014-06-11 14:08:25 ERROR [Thrift:1] CassandraDaemon - Exception in thread Thread[Thrift:1,5,main]
java.lang.NoSuchMethodError: org.apache.cassandra.thrift.CfDef.setIndex_interval(I)Lorg/apache/cassandra/thrift/CfDef;
at org.apache.cassandra.config.CFMetaData.toThrift(CFMetaData.java:1170)
at org.apache.cassandra.config.KSMetaData.toThrift(KSMetaData.java:187)
at org.apache.cassandra.thrift.CassandraServer.describe_keyspace(CassandraServer.java:1106)
at org.apache.cassandra.thrift.CassandraServer.describe_keyspaces(CassandraServer.java:1370)
at org.apache.cassandra.thrift.Cassandra$Processor$describe_keyspaces.getResult(Cassandra.java:3714)
at org.apache.cassandra.thrift.Cassandra$Processor$describe_keyspaces.getResult(Cassandra.java:3702)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:194)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)


I have added the following to my pom.xml:

<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-cassandra</artifactId>
            <version>1.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.cassandraunit</groupId>
            <artifactId>cassandra-unit</artifactId>
            <version>${cassandra-unit.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>cassandra-all</artifactId>
                    <groupId>org.apache.cassandra</groupId>
                </exclusion>
                <exclusion>
                    <groupId>com.datastax.cassandra</groupId>
                    <artifactId>cassandra-driver-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.cassandraunit</groupId>
            <artifactId>cassandra-unit-spring</artifactId>
            <version>${cassandra-unit.version}</version>
            <scope>test</scope>
        </dependency>

The version is set to 2.0.2.1

Any idea?

regards,

Wim

David Webb (Prowave)

unread,
Jun 11, 2014, 8:57:27 AM6/11/14
to Wim Deblauwe, spring-dat...@googlegroups.com
This looks like a question for the the cassandra-unit project since you are not ever getting to a point where SDC* is used.


Dave

--
You received this message because you are subscribed to the Google Groups "Spring Data Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cass...@googlegroups.com.
To post to this group, send email to spring-dat...@googlegroups.com.
Visit this group at http://groups.google.com/group/spring-data-cassandra.
To view this discussion on the web visit https://groups.google.com/d/msgid/spring-data-cassandra/f7824a6d-7059-464c-bae6-4b251e789164%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wim Deblauwe

unread,
Jun 11, 2014, 9:03:27 AM6/11/14
to spring-dat...@googlegroups.com, wim.de...@gmail.com, dw...@prowaveconsulting.com
I did originally ask there, but they where not able to help me. In the mean time, I found that by explictly using cassandra-all 2.0.5, I can run the tests. This is the dependency section of my working pom.xml:

<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-cassandra</artifactId>
            <version>1.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
            <version>2.0.5</version>

regards,

Wim

Op woensdag 11 juni 2014 14:57:27 UTC+2 schreef David Webb (Prowave):
To unsubscribe from this group and stop receiving emails from it, send an email to spring-data-cassandra+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages