0

通过 Intellij IDEA 中的 SBT 控制台运行我的应用程序时出现以下错误。

[info] play - Application started (Dev)
[error] c.i.c.c.t.ThriftClientFactory - Error during pool creation: caused by 
org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
    at net.dataforte.cassandra.pool.ConnectionPool.init(ConnectionPool.java:345) ~[cassandra-connection-pool-0.7.1.jar:na]
    at net.dataforte.cassandra.pool.ConnectionPool.<init>(ConnectionPool.java:127) ~[cassandra-connection-pool-0.7.1.jar:na]
    at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:146) ~[kundera-cassandra-2.5.jar:na]
    at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) [kundera-core-2.5.jar:na]
    at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) [kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
    at org.apache.thrift.transport.TFastFramedTransport.readFrame(TFastFramedTransport.java:144) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.transport.TFastFramedTransport.read(TFastFramedTransport.java:134) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) ~[libthrift-0.7.0.jar:0.7.0]
[error] application - 

! Internal server error, for (GET) [/] ->

java.lang.ExceptionInInitializerError: null
    at models.process.EmployeeProcessImpl$.<init>(EmployeeProcess.scala:82) ~[myEntities.jar:na]
    at models.process.EmployeeProcessImpl$.<clinit>(EmployeeProcess.scala) ~[myEntities.jar:na]
    at controllers.Application$.<init>(Application.scala:168) ~[na:na]
    at controllers.Application$.<clinit>(Application.scala) ~[na:na]
    at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:107) ~[na:na]
Caused by: com.impetus.kundera.loader.ClientLoaderException: org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
    at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:151) ~[kundera-cassandra-2.5.jar:na]
    at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) ~[kundera-core-2.5.jar:na]
    at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) ~[kundera-core-2.5.jar:na]
    at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65) ~[kundera-core-2.5.jar:na]
    at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109) ~[kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
    at net.dataforte.cassandra.pool.ConnectionPool.init(ConnectionPool.java:345) ~[cassandra-connection-pool-0.7.1.jar:na]
    at net.dataforte.cassandra.pool.ConnectionPool.<init>(ConnectionPool.java:127) ~[cassandra-connection-pool-0.7.1.jar:na]
    at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:146) ~[kundera-cassandra-2.5.jar:na]
    at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) ~[kundera-core-2.5.jar:na]
    at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) ~[kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
    at org.apache.thrift.transport.TFastFramedTransport.readFrame(TFastFramedTransport.java:144) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.transport.TFastFramedTransport.read(TFastFramedTransport.java:134) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) ~[libthrift-0.7.0.jar:0.7.0]
    at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) ~[libthrift-0.7.0.jar:0.7.0]
[error] application - Error while rendering default error page
scala.MatchError: java.lang.ExceptionInInitializerError (of class java.lang.ExceptionInInitializerError)
    at play.api.GlobalSettings$class.onError(GlobalSettings.scala:148) ~[play_2.11-2.3.0.jar:2.3.0]
    at play.api.DefaultGlobal$.onError(GlobalSettings.scala:206) [play_2.11-2.3.0.jar:2.3.0]
    at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:76) [play_2.11-2.3.0.jar:2.3.0]
    at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:86) [play_2.11-2.3.0.jar:2.3.0]
    at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:84) [play_2.11-2.3.0.jar:2.3.0]

我正在使用的示例来自: http ://blog.knoldus.com/2014/06/22/playing-kundera-cassandra/

我正在玩!2.4.6 框架与 Cassandra 2.2。不允许连接到数据库的项目可能有什么问题?我是否需要对 CQL 或 Kundera 版本进行一些更改,以便我的数据库可以连接?我的 persistence.xml 文件如下:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    https://raw.github.com/impetus-opensource/Kundera/Kundera-2.0.4/kundera-core/src/test/resources/META-INF/persistence_2_0.xsd"
    version="2.0">

    <persistence-unit name="cassandra_employees">
        <provider>com.impetus.kundera.KunderaPersistence</provider>
        <class>models.domains.Employee</class>
        <properties>
            <property name="kundera.nodes" value="localhost" />
            <property name="kundera.port" value="9042" />
            <property name="kundera.keyspace" value="EmployeeExample" />
            <property name="kundera.dialect" value="cassandra" />
            <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
            <property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider" />
            <property name="kundera.cache.config.resource" value="/ehcache-test.xml" />
        </properties>
    </persistence-unit>

</persistence>

请告诉我是否必须对 Cassandra 或 CQL 进行一些与版本相关的更改,以及在哪个文件中?

4

1 回答 1

0

在配置下使用,它在我的系统上运行良好..

更新 cassandra.yaml:
FROM: start_rpc: false
TO: start_rpc: true

Persistence.xml:
下面提到的单元名称是随机的,将用于访问这个特定的持久性。
keyspace name 是在 cassandra 中创建的表的名称。

<persistence-unit name="persistence">
        <provider>com.impetus.kundera.KunderaPersistence</provider>
        <properties>
            <property name="kundera.nodes" value="localhost" />
            <property name="kundera.port" value="9160" />
            <property name="kundera.keyspace" value="trial1" />
            <property name="kundera.dialect" value="cassandra" />
                <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />

            <property name="kundera.pool.size.max.active" value="500" />
            <property name="kundera.pool.size.max.total" value="500" />
        </properties>
于 2015-12-24T04:37:27.427 回答