今天我在运行junit的时候,用了一个order字段:

@Constraints.Required
@Column(columnDefinition = "int(11) NOT NULL COMMENT '顺序'")
private Integer order;

然后就报错了:

com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, javax.persistence.PersistenceException: Failed to run script
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at Module.configure(Module.java:46) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)
while locating play.api.db.evolutions.DynamicEvolutions
while locating play.api.db.evolutions.ApplicationEvolutionsProvider
at play.api.db.evolutions.EvolutionsModule.<init>(EvolutionsModule.scala:20):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)
while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: javax.persistence.PersistenceException: Failed to run script
at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:126)
at io.ebeaninternal.dbmigration.DdlGenerator.runCreateSql(DdlGenerator.java:154)
at io.ebeaninternal.dbmigration.DdlGenerator.runDdl(DdlGenerator.java:93)
at io.ebeaninternal.dbmigration.DdlGenerator.execute(DdlGenerator.java:68)
at io.ebeaninternal.server.core.DefaultServer.executePlugins(DefaultServer.java:311)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:146)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:45)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:109)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:70)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start$3(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$$52c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:409)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:404)
at play.api.inject.ContextClassLoaderInjector.$anonfun$instanceOf$2(Injector.scala:117)
at play.api.inject.ContextClassLoaderInjector.withContext(Injector.scala:126)
at play.api.inject.ContextClassLoaderInjector.instanceOf(Injector.scala:117)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:49)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:40)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.inject.guice.GuiceBuilder.injector(GuiceBuilder.java:221)
at play.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.java:156)
at AbstractTest.setup(AbstractTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: Error executing stmt[create table et_survey_question ( id bigint auto_increment not null, survey_id int(11) NOT NULL COMMENT '问卷id', question longtext NOT NULL COMMENT '问卷项', deleted bit(1) NOT NULL COMMENT '是否删除', order int(11) NOT NULL COMMENT '顺序', constraint pk_et_survey_question primary key (id) )] error[Syntax error in SQL statement "CREATE TABLE ET_SURVEY_QUESTION ( ID BIGINT AUTO_INCREMENT NOT NULL, SURVEY_ID INT(11) NOT NULL COMMENT '问卷id', QUESTION LONGTEXT NOT NULL COMMENT '问卷项', DELETED BIT(1) NOT NULL COMMENT '是否删除', ORDER[*] INT(11) NOT NULL COMMENT '顺序', CONSTRAINT PK_ET_SURVEY_QUESTION PRIMARY KEY (ID) ) "; expected "identifier"; SQL statement:
create table et_survey_question ( id bigint auto_increment not null, survey_id int(11) NOT NULL COMMENT '问卷id', question longtext NOT NULL COMMENT '问卷项', deleted bit(1) NOT NULL COMMENT '是否删除', order int(11) NOT NULL COMMENT '顺序', constraint pk_et_survey_question primary key (id) ) [42001-197]]
at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:113)
at io.ebean.migration.ddl.DdlRunner.runStatements(DdlRunner.java:70)
at io.ebean.migration.ddl.DdlRunner.runAll(DdlRunner.java:49)
at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:118)
... 84 more
Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE TABLE ET_SURVEY_QUESTION ( ID BIGINT AUTO_INCREMENT NOT NULL, SURVEY_ID INT(11) NOT NULL COMMENT '问卷id', QUESTION LONGTEXT NOT NULL COMMENT '问卷项', DELETED BIT(1) NOT NULL COMMENT '是否删除', ORDER[*] INT(11) NOT NULL COMMENT '顺序', CONSTRAINT PK_ET_SURVEY_QUESTION PRIMARY KEY (ID) ) "; expected "identifier"; SQL statement:
create table et_survey_question ( id bigint auto_increment not null, survey_id int(11) NOT NULL COMMENT '问卷id', question longtext NOT NULL COMMENT '问卷项', deleted bit(1) NOT NULL COMMENT '是否删除', order int(11) NOT NULL COMMENT '顺序', constraint pk_et_survey_question primary key (id) ) [42001-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.getSyntaxError(DbException.java:217)
at org.h2.command.Parser.readColumnIdentifier(Parser.java:3507)
at org.h2.command.Parser.parseTableColumnDefinition(Parser.java:6661)
at org.h2.command.Parser.parseCreateTable(Parser.java:6570)
at org.h2.command.Parser.parseCreate(Parser.java:4615)
at org.h2.command.Parser.parsePrepared(Parser.java:380)
at org.h2.command.Parser.parse(Parser.java:335)
at org.h2.command.Parser.parse(Parser.java:307)
at org.h2.command.Parser.prepareCommand(Parser.java:278)
at org.h2.engine.Session.prepareLocal(Session.java:611)
at org.h2.engine.Session.prepareCommand(Session.java:549)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:304)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:318)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:105)
... 87 more

2) Error injecting constructor, javax.persistence.PersistenceException: Failed to run script
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
while locating play.db.ebean.EbeanDynamicEvolutions
at Module.configure(Module.java:46) (via modules: com.google.inject.util.Modules$OverrideModule -> Module)
while locating play.api.db.evolutions.DynamicEvolutions
Caused by: javax.persistence.PersistenceException: Failed to run script
at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:126)
at io.ebeaninternal.dbmigration.DdlGenerator.runCreateSql(DdlGenerator.java:154)
at io.ebeaninternal.dbmigration.DdlGenerator.runDdl(DdlGenerator.java:93)
at io.ebeaninternal.dbmigration.DdlGenerator.execute(DdlGenerator.java:68)
at io.ebeaninternal.server.core.DefaultServer.executePlugins(DefaultServer.java:311)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:146)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:45)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:109)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:70)
at play.db.ebean.EbeanDynamicEvolutions.lambda$start$3(EbeanDynamicEvolutions.java:49)
at java.util.HashMap.forEach(HashMap.java:1288)
at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:49)
at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:38)
at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$$52c94231.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.inject.guice.GuiceBuilder.injector(GuiceBuilder.java:221)
at play.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.java:156)
at AbstractTest.setup(AbstractTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: Error executing stmt[create table et_activity ( id bigint auto_increment not null, title varchar(255), creator_id bigint, introduction varchar(255), content varchar(255), enroll_start_time datetime, enroll_end_time datetime, max_enroll_number bigint, current_enroll_number bigint, notice_news varchar(255), start_time datetime, end_time datetime, sign_in_start_time datetime, sign_in_end_time datetime, file_id bigint, location varchar(255), location_id bigint, type tinyint, qrcode_content varchar(255), qrcode_id bigint, status tinyint, delete_time datetime, create_time datetime not null, update_time datetime not null, constraint pk_et_activity primary key (id) )] error[Table "ET_ACTIVITY" already exists; SQL statement:
create table et_activity ( id bigint auto_increment not null, title varchar(255), creator_id bigint, introduction varchar(255), content varchar(255), enroll_start_time datetime, enroll_end_time datetime, max_enroll_number bigint, current_enroll_number bigint, notice_news varchar(255), start_time datetime, end_time datetime, sign_in_start_time datetime, sign_in_end_time datetime, file_id bigint, location varchar(255), location_id bigint, type tinyint, qrcode_content varchar(255), qrcode_id bigint, status tinyint, delete_time datetime, create_time datetime not null, update_time datetime not null, constraint pk_et_activity primary key (id) ) [42101-197]]
at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:113)
at io.ebean.migration.ddl.DdlRunner.runStatements(DdlRunner.java:70)
at io.ebean.migration.ddl.DdlRunner.runAll(DdlRunner.java:49)
at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:118)
... 63 more
Caused by: org.h2.jdbc.JdbcSQLException: Table "ET_ACTIVITY" already exists; SQL statement:
create table et_activity ( id bigint auto_increment not null, title varchar(255), creator_id bigint, introduction varchar(255), content varchar(255), enroll_start_time datetime, enroll_end_time datetime, max_enroll_number bigint, current_enroll_number bigint, notice_news varchar(255), start_time datetime, end_time datetime, sign_in_start_time datetime, sign_in_end_time datetime, file_id bigint, location varchar(255), location_id bigint, type tinyint, qrcode_content varchar(255), qrcode_id bigint, status tinyint, delete_time datetime, create_time datetime not null, update_time datetime not null, constraint pk_et_activity primary key (id) ) [42101-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:86)
at org.h2.command.CommandContainer.update(CommandContainer.java:102)
at org.h2.command.Command.executeUpdate(Command.java:261)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:249)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:106)
... 66 more

2 errors

at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.inject.guice.GuiceBuilder.injector(GuiceBuilder.java:221)
at play.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.java:156)
at AbstractTest.setup(AbstractTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


java.lang.NullPointerException
at play.test.Helpers.stop(Helpers.java:606)
at AbstractTest.teardown(AbstractTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

解决方法

@Constraints.Required
@Column(columnDefinition = "int(11) NOT NULL COMMENT '顺序'")
private Integer order_num;

把order改成其他的就行了,因为order数据库里面的sql语句有个order by,是专有名词,我瞬间被打脸了。