开发者社区> 问答> 正文

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

@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


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

展开
收起
爱吃鱼的程序员 2020-06-12 15:40:42 845 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    clean再执行migrate

    你执行的flyway:clean还是mvn:clean已经这样操作了还是没用clean可以正常执行jfinal-demo下面已经是空的
    2020-06-12 15:41:00
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
DTCC 2022大会集锦《云原生一站式数据库技术与实践》 立即下载
阿里云瑶池数据库精要2022版 立即下载
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载