2
votes

Installed CassandraVM-2.0.7.ova. Which version of Kundera works properly with this version of Cassandra? Facing too many issues trying to get this information. Could be my mistake in configuration. Is this information documented somewhere?

I tried with this maven dependency:

<dependency> <groupId>com.impetus.kundera.client</groupId> <artifactId>kundera-cassandra</artifactId> <version>3.2</version> </dependency>

Properties in persistence.xml is as follows:

<persistence-unit name="cassandra_pu">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <properties>
        <property name="kundera.nodes" value="a.b.com" />
        <property name="kundera.port" value="9042"/>
        <property name="kundera.keyspace" value="KunderaExamples" />
        <property name="kundera.dialect" value="cassandra" />
        <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
        <property name="kundera.ddl.auto.prepare" value="create" />
    </properties>
</persistence-unit>

While trying to execute the below statement,

EntityManagerFactory emf = Persistence.createEntityManagerFactory("cassandra_pu");

this exception occurred:

Exception in thread "main" com.impetus.kundera.configure.schema.SchemaGenerationException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2113929216)!
at com.impetus.client.cassandra.schemamanager.CassandraSchemaManager.create(CassandraSchemaManager.java:264)
at com.impetus.kundera.configure.schema.api.AbstractSchemaManager.handleOperations(AbstractSchemaManager.java:264)
at com.impetus.kundera.configure.schema.api.AbstractSchemaManager.exportSchema(AbstractSchemaManager.java:115)
at com.impetus.client.cassandra.schemamanager.CassandraSchemaManager.exportSchema(CassandraSchemaManager.java:166)
at com.impetus.kundera.configure.SchemaConfiguration.configure(SchemaConfiguration.java:188)
at com.impetus.kundera.configure.ClientMetadataBuilder.buildClientFactoryMetadata(ClientMetadataBuilder.java:48)
at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configureClientFactories(EntityManagerFactoryImpl.java:408)
at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configure(EntityManagerFactoryImpl.java:161)
at com.impetus.kundera.persistence.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:135)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at Main.main(Main.java:16)

I then tried with a much older release of Kundera (2.4) and faced the same issue. I guess I am missing something fundamental.

Removed the automatic schema generation option in persistence.xml and am still facing the same issue (Unable to create a new Cassandra connection. org.apache.thrift.transport.TTransportException: Read a negative frame size (-2113929216)!.)

On the server, this is the exception:

java.lang.ArrayIndexOutOfBoundsException: 47
at org.apache.cassandra.transport.Message$Type.fromOpcode(Message.java:106)
at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:168)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)

1
Try with the latest version.. You can refer this documentkarthik manchala
Can you please add errors & exceptions and the code you tried?Dev
It would be better for the community if you edit your question with all these details.Dev

1 Answers

0
votes

Thrift clients need to used port 9160 and not 9042. Now it is working fine.