1

我在 [ https://github.com/firekat/play-kundera] ( https://github.com/firekat/play-kundera )上尝试了 kundera cassandra over 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
screenshoot http://c1302.hizliresim.com/16/3/jqzdp.png插入数据

4

1 回答 1

1

根据错误:

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: 执行异常 [[PersistenceLoaderException: com.impetus.kundera.utils.InvalidConfigurationException: Duplicate persistence-units for name: cassandra_pu. 验证您的 persistence.xml 文件]] at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:82) [play_2.9.1.jar:2.0] at 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] 在 akka.actor.ActorCell.invoke(ActorCell.scala:617) [akka-actor.jar:2.0] 在 akka.dispatch.Mailbox.processMailbox (Mailbox.scala:179) [akka-actor.jar:2.0] 在 akka.dispatch.Mailbox.run(Mailbox.scala:161) [akka-actor.jar:2.0] 在 akka.dispatch。 引起: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。配置(Configurator.java:64)~[kundera-cassandra-2.2.1-jar-with-dependencies.jar:na] at 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-卡桑德拉-2.2。1-jar-with-dependencies.jar:na]

====================================我建议你在(META-INF/persistence .xml) 并尝试运行它。

-维维克

于 2013-02-04T12:43:58.467 回答