Kundera用cassandra 1.1.9和play framework 2.0.4

时间:2013-02-03 21:18:54

标签: playframework-2.0 cassandra kundera

我在[https://github.com/firekat/play-kundera]https://github.com/firekat/play-kundera)上尝试了kundera cassandra而不是java play framework 2.0.4示例。
我得到例外..异常堆栈跟踪
2013-02-03 22:56:35,201 - [ERROR] - from com.impetus.kundera.persistence.PersistenceValidator in play-akka.actor.actions-dispatcher-9 class models.User is not a JPA managed object as we couldn't find metadata for it. This object can't be persisted 2013-02-03 22:56:35,230 - [ERROR] - from application in play-akka.actor.actions-dispatcher-9 ! @6d86e1m37 - Internal server error, for request [GET /user/create/:Emin] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[KunderaException: java.lang.IllegalArgumentException: Entity object is invalid, operation failed. Please check previous log message for details]] at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.4] at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.4] at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2] at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.4] at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2] at akka.dispatch.Mailbox.run(Mailbox.scala:179) [akka-actor.jar:2.0.2] at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) [akka-actor.jar:2.0.2] at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor.jar:2.0.2] at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [akka-actor.jar:2.0.2] at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) [akka-actor.jar:2.0.2] at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor.jar:2.0.2] Caused by: com.impetus.kundera.KunderaException: java.lang.IllegalArgumentException: Entity object is invalid, operation failed. Please check previous log message for details at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:220) ~[kundera-core-2.3.jar:na] at controllers.KunderaApp.createUser(KunderaApp.java:26) ~[classes/:na] at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] at play.core.Router$HandlerInvoker$$anon$5$$anon$1.invocation(Router.scala:1090) ~[play_2.9.1.jar:2.0.4] at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:33) ~[play_2.9.1.jar:2.0.4] at play.db.jpa.TransactionalAction$1.apply(TransactionalAction.java:19) ~[play_2.9.1.jar:2.0.4] at play.db.jpa.TransactionalAction$1.apply(TransactionalAction.java:17) ~[play_2.9.1.jar:2.0.4] at play.db.jpa.JPA.withTransaction(JPA.java:104) ~[play_2.9.1.jar:2.0.4] at play.db.jpa.TransactionalAction.call(TransactionalAction.java:14) ~[play_2.9.1.jar:2.0.4] at play.core.j.JavaAction$class.apply(JavaAction.scala:74) ~[play_2.9.1.jar:2.0.4] at play.core.Router$HandlerInvoker$$anon$5$$anon$1.apply(Router.scala:1089) ~[play_2.9.1.jar:2.0.4] at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.4] at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.4] at play.utils.Threads$.withContextClassLoader(Threads.scala:17) ~[play_2.9.1.jar:2.0.4] at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:125) [play_2.9.1.jar:2.0.4] ... 11 common frames omitted Caused by: java.lang.IllegalArgumentException: Entity object is invalid, operation failed. Please check previous log message for details at com.impetus.kundera.persistence.PersistenceDelegator.persist(PersistenceDelegator.java:146) ~[kundera-core-2.3.jar:na] at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:214) ~[kundera-core-2.3.jar:na] ... 26 common frames omitted您可能认为我创建了我的键空间和列族。这就是我在cassandra -cli中所做的,我检查它是否有效,我可以通过-cli确认数据<{3}}

1 个答案:

答案 0 :(得分:1)

根据错误:

play.core.ActionInvoker $$ anonfun $ receive $ 1 $$ anon $ 1:执行异常[[PersistenceLoaderException:com.impetus.kundera.utils.InvalidConfigurationException:名称的重复持久性单位:cassandra_pu。验证你的persistence.xml文件]]     at play.core.ActionInvoker $$ anonfun $ receive $ 1.apply(Invoker.scala:82)[play_2.9.1.jar:2.0]     在play.core.ActionInvoker $$ anonfun $ receive $ 1.apply(Invoker.scala:63)[play_2.9.1.jar:2.0]     at akka.actor.Actor $ class.apply(Actor.scala:290)[akka-actor.jar:2.0]     at play.core.ActionInvoker.apply(Invoker.scala:61)[play_2.9.1.jar:2.0]     at akka.actor.ActorCell.invoke(ActorCell.scala:617)[akka-actor.jar:2.0]     at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:179)[akka-actor.jar:2.0]     at akka.dispatch.Mailbox.run(Mailbox.scala:161)[akka-actor.jar:2.0]     at akka.dispatch.ForkJoinExecutorConfigurator $ MailboxExecutionTask.exec(AbstractDispatcher.scala:505)[akka-actor.jar:2.0]     at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)[akka-actor.jar:2.0]     at akka.jsr166y.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:997)[akka-actor.jar:2.0]     at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495)[akka-actor.jar:2.0]     at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)[akka-actor.jar:2.0] 引起:com.impetus.kundera.loader.PersistenceLoaderException:com.impetus.kundera.utils.InvalidConfigurationException:名称的重复持久性单位:cassandra_pu。验证您的persistence.xml文件     在com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:103)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]     在com.impetus.kundera.configure.Configurator.configure(Configurator.java:64)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]     在com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:103)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]     在com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]     在javax.persistence.Persistence.createEntityManagerFactory(未知来源)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]     在javax.persistence.Persistence.createEntityManagerFactory(未知来源)〜[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na]

=================================== 我建议你在(META-INF / persistence.xml)下更改持久性单元名称并尝试运行它。

-Vivek