1

I am trying to export the .war file but at the time of doing clean and build it throws me errors of liquibase. In the IDE run perfectly fine. I stress that this happened after adding some roles as indicated in this question: Using ROLES in jhipster?

This is the error thrown by the console:

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]
----------------------------------------------------------
´

I would greatly appreciate your help. Sorry for the bad English.

  • the log that you are showing is not the log from starting the app because it shows that at the end the application is started and running. You need to make a mvn clean install in order to create a war file. – duderoot Feb 27 '18 at 16:25
  • How should I do this? removing the changelog files? that's what I did and it did not work – FacundoSuarez Feb 27 '18 at 23:05
  • Do you have different databases? Looks like your changelogs are corrupt and the system tries to create the JHI_USER although it already exists. Another option could be to turn off the async starting of the database... – Indivon Feb 28 '18 at 19:40

0 Answers0