生成.war文件JHipster

时间:2018-02-27 14:34:04

标签: java mysql spring jhipster

我正在尝试导出.war文件,但在进行清理和构建时,它会抛出liquibase的错误。在IDE中运行完全正常。 我强调这是在添加了一些角色后发生的,如此问题所示:Using ROLES in jhipster?

这是控制台抛出的错误:

2018-02-27 11:20:40.764  WARN 8156 --- [as-4-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase asynchronously, your database might not be ready at startup!
2018-02-27 11:20:43.048 ERROR 8156 --- [as-4-Executor-1] liquibase                                : classpath:config/liquibase/master.xml: config/liquibase/changelog/00000000000000_initial_schema.xml::00000000000001::jhipster: Change Set config/liquibase/changelog/00000000000000_initial_schema.xml::00000000000001::jhipster failed.  Error: Tabla "JHI_USER" ya existe
Table "JHI_USER" already exists; SQL statement:
CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email)) [42101-196] [Failed SQL: CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email))]
2018-02-27 11:20:43.110 ERROR 8156 --- [as-4-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase could not start correctly, your database is NOT ready: Migration failed for change set config/liquibase/changelog/00000000000000_initial_schema.xml::00000000000001::jhipster:
     Reason: liquibase.exception.DatabaseException: Tabla "JHI_USER" ya existe
Table "JHI_USER" already exists; SQL statement:
CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email)) [42101-196] [Failed SQL: CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email))]

liquibase.exception.MigrationFailedException: Migration failed for change set config/liquibase/changelog/00000000000000_initial_schema.xml::00000000000001::jhipster:
     Reason: liquibase.exception.DatabaseException: Tabla "JHI_USER" ya existe
Table "JHI_USER" already exists; SQL statement:
CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email)) [42101-196] [Failed SQL: CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email))]
    at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
    at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
    at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
    at liquibase.Liquibase.update(Liquibase.java:214)
    at liquibase.Liquibase.update(Liquibase.java:192)
    at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:388)
    at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:82)
    at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:64)
    at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: liquibase.exception.DatabaseException: Tabla "JHI_USER" ya existe
Table "JHI_USER" already exists; SQL statement:
CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email)) [42101-196] [Failed SQL: CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email))]
    at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
    at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
    at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
    at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
    ... 12 common frames omitted
Caused by: org.h2.jdbc.JdbcSQLException: Tabla "JHI_USER" ya existe
Table "JHI_USER" already exists; SQL statement:
CREATE TABLE PUBLIC.jhi_user (id BIGINT AUTO_INCREMENT NOT NULL, login VARCHAR(50) NOT NULL, password_hash VARCHAR(60), first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100), image_url VARCHAR(256), activated BOOLEAN NOT NULL, lang_key VARCHAR(6), activation_key VARCHAR(20), reset_key VARCHAR(20), created_by VARCHAR(50) NOT NULL, created_date TIMESTAMP DEFAULT NOW() NOT NULL, reset_date TIMESTAMP, last_modified_by VARCHAR(50), last_modified_date TIMESTAMP, CONSTRAINT PK_JHI_USER PRIMARY KEY (id), CONSTRAINT ux_user_login UNIQUE (login), CONSTRAINT ux_user_email UNIQUE (email)) [42101-196]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    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:117)
    at org.h2.command.CommandContainer.update(CommandContainer.java:101)
    at org.h2.command.Command.executeUpdate(Command.java:260)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:192)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:164)
    at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:92)
    at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
    at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
    ... 17 common frames omitted
´
2018-02-27 11:20:49.728 DEBUG 8156 --- [  restartedMain] i.g.j.c.apidoc.SwaggerConfiguration      : Starting Swagger
2018-02-27 11:20:49.729 DEBUG 8156 --- [  restartedMain] i.g.j.c.apidoc.SwaggerConfiguration      : Started Swagger in 0 ms
2018-02-27 11:20:51.944  INFO 8156 --- [  restartedMain] municipalidad.obras.ObrasPrivadas4App    : Started ObrasPrivadas4App in 17.765 seconds (JVM running for 18.308)
2018-02-27 11:20:51.945  INFO 8156 --- [  restartedMain] municipalidad.obras.ObrasPrivadas4App    : 
----------------------------------------------------------
    Application 'obrasPrivadas4' is running! Access URLs:
    Local:      http://localhost:8080
    External:   http://192.168.48.28:8080
    Profile(s):     [swagger, dev]
----------------------------------------------------------
´

非常感谢你的帮助。抱歉英语不好。

0 个答案:

没有答案