请教一下jfinal-demo的数据库初始化问题?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

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

爱吃鱼的程序员 2020-06-12 15:40:42 106

@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


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

关系型数据库 MySQL Java 数据库连接 数据库 Maven
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-12 15:41:00

    clean再执行migrate

    你执行的flyway:clean还是mvn:clean已经这样操作了还是没用clean可以正常执行jfinal-demo下面已经是空的
    0 0
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程