2

Im using Cassandra-Unit 3.1.3.2 for doing unit testing.

Below is my code snippet

EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE);
    appConfig.setCassandraPort(EmbeddedCassandraServerHelper.getNativeTransportPort());
    appConfig.setCassandraSession(Cluster.builder().addContactPoints(InetAddress.getByName("localhost").getHostAddress())
        .withPort(54567).build().connect());
    CqlSchemaInitializer cqlSchemaInitializer = new CqlSchemaInitializer(Arrays.asList("create_keyspace.cql"));
    cqlSchemaInitializer.initialize(appConfig.getCassandraSession());
    appConfig.setCassandraLodgingCommerceContentDao(new CassandraLodgingCommerceContentDao(appConfig.getCassandraSession()));

appConfig is just the pojo which has setter/getter. Im getting the below error,

Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.datastax.driver.core.NettyUtil.newEventLoopGroupInstance(NettyUtil.java:134) ... 35 more Caused by: java.lang.NoSuchFieldError: DEFAULT_MAX_PENDING_TASKS at io.netty.channel.epoll.EpollEventLoop.(EpollEventLoop.java:84) at io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:114) at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:64) at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:49) at io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:93) at io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:80) at io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:61) ... 40 more

1 Answer 1

4

After adding the below dependency it got resolved

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.44.Final</version>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.