嗨所以我创建了一个快速表:
package models;
import javax.persistence.*;
import play.db.ebean.Model;
@Entity
public class Phone extends Model {
@Id
public Long phoneID;
public String group;
public String name;
}
我收到以下错误:
PersistenceException:获取序列nextval时出错 javax.persistence.PersistenceException:获取序列nextval时出错 com.avaje.ebean.config.dbplatform.SequenceIdGenerator.getMoreIds(SequenceIdGenerator.java:213) com.avaje.ebean.config.dbplatform.SequenceIdGenerator.loadMoreIds(SequenceIdGenerator.java:163) com.avaje.ebean.config.dbplatform.SequenceIdGenerator.nextId(SequenceIdGenerator.java:118) com.avaje.ebeaninternal.server.deploy.BeanDescriptor.nextId(BeanDescriptor.java:1218) com.avaje.ebeaninternal.server.persist.DefaultPersister.setIdGenValue(DefaultPersister.java:1304) com.avaje.ebeaninternal.server.persist.DefaultPersister.insert(DefaultPersister.java:403) com.avaje.ebeaninternal.server.persist.DefaultPersister.saveEnhanced(DefaultPersister.java:345) com.avaje.ebeaninternal.server.persist.DefaultPersister.saveRecurse(DefaultPersister.java:315) com.avaje.ebeaninternal.server.persist.DefaultPersister.save(DefaultPersister.java:282) com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.java:1577) com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.java:1567) com.avaje.ebean.Ebean.save(Ebean.java:538)play.db.ebean.Model.save(Model.java:76) models.Command.createCommand(Command.java:100) models.Command.populateCommands(Command.java:68) Global.onStart(Global.java:22)play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:15) play.api.GlobalPlugin.onStart(Global.scala:134) play.api.Play $$ anonfun $开始$ 1.适用(Play.scala:60) play.api.Play $$ anonfun $开始$ 1.适用(Play.scala:60) scala.collection.LinearSeqOptimized $ class.foreach(LinearSeqOptimized.scala:59) scala.collection.immutable.List.foreach(List.scala:45) play.api.Play $。开始(Play.scala:60) play.core.ReloadableApplication $$ anonfun $得到$ 1 $$ anonfun $ $申请3 $$ anonfun $ 1.适用(ApplicationProvider.scala:125) play.core.ReloadableApplication $$ anonfun $得到$ 1 $$ anonfun $ $申请3 $$ anonfun $ 1.适用(ApplicationProvider.scala:112) scala.Option.map(Option.scala:133) play.core.ReloadableApplication $$ anonfun $得到$ 1 $$ anonfun $ $申请3.apply(ApplicationProvider.scala:112) play.core.ReloadableApplication $$ anonfun $得到$ 1 $$ anonfun $ $申请3.apply(ApplicationProvider.scala:110) scala.Either $ RightProjection.flatMap(Either.scala:277) play.core.ReloadableApplication $$ anonfun $得到$ 1.适用(ApplicationProvider.scala:110) play.core.ReloadableApplication $$ anonfun $得到$ 1.适用(ApplicationProvider.scala:110) akka.dispatch.Future $$不久$ 3.liftedTree1 $ 1(Future.scala:195) akka.dispatch.Future $$匿名$ 3.run(Future.scala:194) akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83) akka.jsr166y.ForkJoinTask $ AdaptedRunnableAction.exec(ForkJoinTask.java:1381) akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) akka.jsr166y.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:974) akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1478) akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
我是否允许使用h2内存数据库的最大表数?我真的不明白这个错误来自哪里。如果我删除这一行它工作正常,但它看起来像另一个类导致问题:createCommand,它只有以下内容:
public static void create(Command data) {
data.save();
}
public static void populateCommands() {
createCommand(0x00, "Cmd1");
createCommand(0x02, "Cmd2");
createCommand(0x03, "Cmd3");
}
任何帮助表示感谢。
答案 0 :(得分:0)
我认为问题是我开了日食。 我注意到eclipse和play同时运行的一些问题。 我需要关闭eclipse运行play框架和再次打开eclipse。