ThriftClientFactory/9160 => DSClientFactory/9042

28 views
Skip to first unread message

George Wu

unread,
Jul 4, 2016, 2:02:54 AM7/4/16
to kundera...@googlegroups.com

Hi, all:

After I upgrade cassandra from 2.1 to 2.2, and kundera to 3.5
it seems the thrift port is no more available.
netstat can't find 9160. But I can see 9042 is listening.
I don't know how to enable thrift.
So I have to change client from ThriftClientFactory to DSClientFactory

I have read this page.
https://github.com/impetus-opensource/Kundera/issues/670

Where is the package for DSClientFactory? I can't find it in the jar file.
Thanks.

George Wu

///////////////////////
Caused by: com.impetus.kundera.KunderaException: All hosts are down. please chec
k servers manully.
        at com.impetus.client.cassandra.thrift.ThriftClientFactory.getPoolUsingP
olicy(ThriftClientFactory.java:215)
        at com.impetus.client.cassandra.thrift.ThriftClientFactory.instantiateCl
ient(ThriftClientFactory.java:200)
        at com.impetus.kundera.loader.GenericClientFactory.getClientInstance(Gen
ericClientFactory.java:259)
        at com.impetus.kundera.persistence.EntityManagerImpl.discoverClient(Enti
tyManagerImpl.java:990)
        at com.impetus.kundera.persistence.EntityManagerImpl.<init>(EntityManage
rImpl.java:142)
        at com.impetus.kundera.persistence.EntityManagerFactoryImpl.createEntity
Manager(EntityManagerFactoryImpl.java:250)


George Wu

unread,
Jul 4, 2016, 7:29:42 AM7/4/16
to kundera...@googlegroups.com

https://github.com/impetus-opensource/Kundera/wiki/Datastax-java-driver-support-for-Cassandra-using-Kundera

Now I added this line to the pom.xml
<dependency>
            <groupId>com.impetus.kundera.client</groupId>
            <artifactId>kundera-cassandra-ds-driver</artifactId>
            <version>3.5</version>
</dependency>

    <persistence-unit name="cassandra_pu">
        <provider>com.impetus.kundera.KunderaPersistence</provider>
        <properties>
            <property name="kundera.nodes" value="localhost"/>
            <property name="kundera.port" value="9042"/>
            <property name="kundera.keyspace" value="xxx"/>
            <property name="kundera.dialect" value="cassandra"/>
            <property name="kundera.pool.size.max.active" value="200" />
            <property name="kundera.pool.size.max.total" value="200" />
            <property name="kundera.client.lookup.class" value="com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory" />
            <property name="kundera.client.property" value="cassandra.xml" />
        </properties>
    </persistence-unit>
   

But I got the following exception:
Can anybody help? thanks.



Caused by: java.lang.ExceptionInInitializerError
        at com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory.createP
oolOrConnection(DSClientFactory.java:188)
        at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFac
tory.java:119)
        at com.impetus.kundera.configure.ClientMetadataBuilder.buildClientFactor
yMetadata(ClientMetadataBuilder.java:55)
        at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configureCli
entFactories(EntityManagerFactoryImpl.java:408)
        at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configure(En
tityManagerFactoryImpl.java:161)
        at com.impetus.kundera.persistence.EntityManagerFactoryImpl.<init>(Entit
yManagerFactoryImpl.java:135)
        at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(Kun
deraPersistence.java:85)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:79)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:54)


--
You received this message because you are subscribed to the Google Groups "kundera-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kundera-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

karthik prasad

unread,
Jul 11, 2016, 3:40:45 AM7/11/16
to kundera-discuss
Hey George,

You can enable thrift by changing start_rpc property to true in cassandra.yaml file in conf directory.

Thanks,
Karthik.

George Wu

unread,
Jul 17, 2016, 9:13:48 PM7/17/16
to kundera...@googlegroups.com
Karthik:

Thanks.
It works.

George Wu



Reply all
Reply to author
Forward
0 new messages