请教一下jfinal-demo的数据库初始化问题

牛奶拌饭 发布于 2015/07/20 17:07
阅读 1K+
收藏 0

@Dreampie 你好,想跟你请教个问题:

我在jfinal-demo中使用cn.dreampie:flyway-maven-plugin:1.0:migrate启动,结果报错:

[info] location:filesystem:D:\WorkZone\GitHub\jfinal-demo/src/main/resources/db/migration/default
七月 20, 2015 5:07:25 下午 org.flywaydb.core.internal.dbsupport.DbSupportFactory createDbSupport
INFO: Database: jdbc:mysql://localhost:3306/jfinal_demo?useUnicode=true&characterEncoding=UTF-8 (MySQL 5.5)
七月 20, 2015 5:07:25 下午 org.flywaydb.core.internal.command.DbValidate validate
INFO: Validated 5 migrations (execution time 00:00.057s)
七月 20, 2015 5:07:25 下午 org.flywaydb.core.internal.command.DbMigrate migrate
INFO: Current version of schema `jfinal_demo`: 1

[ERROR] Failed to execute goal cn.dreampie:flyway-maven-plugin:1.0:migrate (default-cli) on project jfinal-demo: Execution default-cli of goal cn.dreampie:flyway-maven-plugin:1.0:migrate failed: Schema `jfinal_demo` contains a failed migration to version 1 ! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal cn.dreampie:flyway-maven-plugin:1.0:migrate (default-cli) on project jfinal-demo: Execution default-cli of goal cn.dreampie:flyway-maven-plugin:1.0:migrate failed: Schema `jfinal_demo` contains a failed migration to version 1 !
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal cn.dreampie:flyway-maven-plugin:1.0:migrate failed: Schema `jfinal_demo` contains a failed migration to version 1 !
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.flywaydb.core.api.FlywayException: Schema `jfinal_demo` contains a failed migration to version 1 !
at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:196)
at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)
at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:864)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:811)
at org.flywaydb.core.Flyway.execute(Flyway.java:1171)
at org.flywaydb.core.Flyway.migrate(Flyway.java:811)
at cn.dreampie.AbstractFlywayMojo.migrateAutomatically(AbstractFlywayMojo.java:140)
at cn.dreampie.AbstractFlywayMojo.migrate(AbstractFlywayMojo.java:96)
at cn.dreampie.MigrateMojo.execute(MigrateMojo.java:28)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
... 21 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException


数据库已正常连接.这是哪有问题了?

加载中
0
Dreampie
Dreampie

clean 再执行 migrate

Dreampie
Dreampie
你执行的 flyway:clean 还是mvn:clean
牛奶拌饭
牛奶拌饭
已经这样操作了 还是没用 clean可以正常执行 jfinal-demo下面已经是空的
返回顶部
顶部