Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

Connection pool doesn't work with username and password set up #658

Open jamesxukun opened 9 years ago

jamesxukun commented 9 years ago

I have Spring framework set up with Cassandra database, everything is work fine. However, as long as I created a Cassandra super user with password, and set up the properties in persisten.xml file, it gave me following error message:

Caused by: InvalidRequestException(why:You have not logged in) at org.apache.cassandra.thrift.Cassandra$get_range_slices_result$get_range_slices_resultStandardScheme.read(Cassandra.java:17430) at org.apache.cassandra.thrift.Cassandra$get_range_slices_result$get_range_slices_resultStandardScheme.read(Cassandra.java:17397) at org.apache.cassandra.thrift.Cassandra$get_range_slices_result.read(Cassandra.java:17323) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_get_range_slices(Cassandra.java:802) at org.apache.cassandra.thrift.Cassandra$Client.get_range_slices(Cassandra.java:786) at com.impetus.client.cassandra.thrift.ThriftClient.find(ThriftClient.java:956)

Here is part of my persistence.xml file:

<persistence-unit name="cassandra">
        <provider>com.impetus.kundera.KunderaPersistence</provider>
        <properties>
           <property name="kundera.dialect" value="cassandra"/>
           <property name="cql.version" value="3.0.0"/>
        <property name="kundera.nodes" value="10.20.20.80"/>
        <property name="kundera.port" value="9160"/>
<property name="kundera.keyspace" value="cls"/>
<property name="kundera.username" value="icontrol"/>
<property name="kundera.password" value="test"/>
<property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory"/>
           <!-- other deployment specific parameters should be provided in a separate properties file  -->
           <property name="kundera.ddl.auto.prepare" value="validate"/>
           <property name="kundera.client.property" value="mykunderaLoadConfig.xml" />
    </properties>
    </persistence-unit>

I am running 2.11.1 and cassandra-hrifty 2.0.5.

Please let me what I have been done wrong.

Thanks, James

chhavigangwal commented 9 years ago

@jamesxukun

Although we are looking into the issue but just to ensure does the authentication works without connection pool in your case? Also, Kundera versions older than 2.12.1 support Cassandra 1.x and latter ones are most compatible with 2.0.4. So I would suggest you to upgrade Kundera to the latest version 2.14.

Chhavi

jamesxukun commented 9 years ago

Hi Chhavi,

Thanks for your response.

Yes, it is working fine if I didn't have any kunderaExtendConfig.xml, means everything is defined in persistence.xml.

And also I found that if I define the kunderaExtendConfig.xml, I can put the username and password properties in the file, under the section, it works.

chhavigangwal commented 9 years ago

@jamesxukun

So is the code working fine at your end now ?

Chhavi

chhavigangwal commented 9 years ago

@jamesxukun

Are we good to close on this ?

Chhavi

jamesxukun commented 9 years ago

OK, you can close it. I word around it, the issue still there.

chhavigangwal commented 9 years ago

@jamesxukun

The issue is not reproducible at my end .So can you please mail me the sample project which will help me look into the issue further ?

Chhavi