向jhi_user添加更多表列时出错

时间:2017-03-18 03:40:11

标签: jhipster

我有一个jhipter应用,我想在salt表中添加jhi_user列。我在salt表格中添加了jhi_user列,并将salt属性添加到User域和UserDTO。当run mvnw -Pprod,swagger,no-liquibase package我收到错误时:

iveEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPro
pertiesSet(AbstractEntityManagerFactoryBean.java:362)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:197)
        at org.springframework.context.support.AbstractApplicationContext.getBea
n(AbstractApplicationContext.java:1081)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:856)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:542)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.
java:737)
        at org.springframework.boot.SpringApplication.refreshContext(SpringAppli
cation.java:370)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java
:314)
        at org.springframework.boot.test.context.SpringBootContextLoader.loadCon
text(SpringBootContextLoader.java:120)
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoader
Delegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoader
Delegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
        at org.springframework.test.context.support.DefaultTestContext.getApplic
ationContext(DefaultTestContext.java:83)
        at org.springframework.test.context.web.ServletTestExecutionListener.set
UpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
        at org.springframework.test.context.web.ServletTestExecutionListener.pre
pareTestInstance(ServletTestExecutionListener.java:131)
        at org.springframework.test.context.TestContextManager.prepareTestInstan
ce(TestContextManager.java:230)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.creat
eTest(SpringJUnit4ClassRunner.java:228)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.run
ReflectiveCall(SpringJUnit4ClassRunner.java:287)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:12)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.metho
dBlock(SpringJUnit4ClassRunner.java:289)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runCh
ild(SpringJUnit4ClassRunner.java:247)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runCh
ild(SpringJUnit4ClassRunner.java:94)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClass
Callbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassC
allbacks.evaluate(RunAfterTestClassCallbacks.java:70)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(S
pringJUnit4ClassRunner.java:191)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provide
r.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUni
t4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4
Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider
.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameCla
ssLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork
edBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
103)
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-valid
ation: missing column [salt] in table [jhi_user]
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTa
ble(AbstractSchemaValidator.java:136)
        at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validat
eTables(GroupedSchemaValidatorImpl.java:42)
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performVal
idation(AbstractSchemaValidator.java:89)
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidati
on(AbstractSchemaValidator.java:68)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.perform
DatabaseAction(SchemaManagementToolCoordinator.java:191)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process
(SchemaManagementToolCoordinator.java:72)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.j
ava:309)
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFa
ctoryBuilderImpl.java:445)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build
(EntityManagerFactoryBuilderImpl.java:889)
        at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvi
der.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.ja
va:60)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.cr
eateNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNat
iveEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPro
pertiesSet(AbstractEntityManagerFactoryBean.java:362)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:197)
        at org.springframework.context.support.AbstractApplicationContext.getBea
n(AbstractApplicationContext.java:1081)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:856)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:542)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.
java:737)
        at org.springframework.boot.SpringApplication.refreshContext(SpringAppli
cation.java:370)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java
:314)
        at org.springframework.boot.test.context.SpringBootContextLoader.loadCon
text(SpringBootContextLoader.java:120)
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoader
Delegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoader
Delegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
        at org.springframework.test.context.support.DefaultTestContext.getApplic
ationContext(DefaultTestContext.java:83)
        at org.springframework.test.context.web.ServletTestExecutionListener.set
UpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
        at org.springframework.test.context.web.ServletTestExecutionListener.pre
pareTestInstance(ServletTestExecutionListener.java:131)
        at org.springframework.test.context.TestContextManager.prepareTestInstan
ce(TestContextManager.java:230)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.creat
eTest(SpringJUnit4ClassRunner.java:228)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.run
ReflectiveCall(SpringJUnit4ClassRunner.java:287)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:12)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.metho
dBlock(SpringJUnit4ClassRunner.java:289)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runCh
ild(SpringJUnit4ClassRunner.java:247)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runCh
ild(SpringJUnit4ClassRunner.java:94)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClass
Callbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassC
allbacks.evaluate(RunAfterTestClassCallbacks.java:70)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(S
pringJUnit4ClassRunner.java:191)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provide
r.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUni
t4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4
Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider
.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameCla
ssLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork
edBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
103)


Results :

Tests in error:
  UserServiceIntTest.assertThatAnonymousUserIsNotGet » IllegalState Failed to lo
...
  UserServiceIntTest.assertThatOnlyActivatedUserCanRequestPasswordReset » Illega
lState
  UserServiceIntTest.assertThatResetKeyMustBeValid » IllegalState Failed to load
...
  UserServiceIntTest.assertThatResetKeyMustNotBeOlderThan24Hours » IllegalState
...
  UserServiceIntTest.assertThatUserCanResetPassword » IllegalState Failed to loa
...
  UserServiceIntTest.assertThatUserMustExistToResetPassword » IllegalState Faile
...
  UserServiceIntTest.testFindNotActivatedUsersByCreationDateBefore » IllegalStat
e
  AccountResourceIntTest.testAuthenticatedUser » IllegalState Failed to load App
...
  AccountResourceIntTest.testGetExistingAccount » IllegalState Failed to load Ap
...
  AccountResourceIntTest.testGetUnknownAccount » IllegalState Failed to load App
...
  AccountResourceIntTest.testNonAuthenticatedUser » IllegalState Failed to load
...
  AccountResourceIntTest.testRegisterAdminIsIgnored » IllegalState Failed to loa
...
  AccountResourceIntTest.testRegisterDuplicateEmail » IllegalState Failed to loa
...
  AccountResourceIntTest.testRegisterDuplicateLogin » IllegalState Failed to loa
...
  AccountResourceIntTest.testRegisterInvalidEmail » IllegalState Failed to load
...
  AccountResourceIntTest.testRegisterInvalidLogin » IllegalState Failed to load
...
  AccountResourceIntTest.testRegisterInvalidPassword » IllegalState Failed to lo
...
  AccountResourceIntTest.testRegisterValid » IllegalState Failed to load Applica
...
  AccountResourceIntTest.testSaveInvalidLogin » IllegalState Failed to load Appl
...
  AuditResourceIntTest.getAllAudits » IllegalState Failed to load ApplicationCon
...
  AuditResourceIntTest.getAudit » IllegalState Failed to load ApplicationContext

  AuditResourceIntTest.getAuditsByDate » IllegalState Failed to load Application
...
  AuditResourceIntTest.getNonExistingAudit » IllegalState Failed to load Applica
...
  AuditResourceIntTest.getNonExistingAuditsByDate » IllegalState Failed to load
...
  AuthorResourceIntTest.checkNameIsRequired » IllegalState Failed to load Applic
...
  AuthorResourceIntTest.createAuthor » IllegalState Failed to load ApplicationCo
...
  AuthorResourceIntTest.createAuthorWithExistingId » IllegalState Failed to load
...
  AuthorResourceIntTest.deleteAuthor » IllegalState Failed to load ApplicationCo
...
  AuthorResourceIntTest.equalsVerifier » IllegalState Failed to load Application
...
  AuthorResourceIntTest.getAllAuthors » IllegalState Failed to load ApplicationC
...
  AuthorResourceIntTest.getAuthor » IllegalState Failed to load ApplicationConte
...
  AuthorResourceIntTest.getNonExistingAuthor » IllegalState Failed to load Appli
...
  AuthorResourceIntTest.searchAuthor » IllegalState Failed to load ApplicationCo
...
  AuthorResourceIntTest.updateAuthor » IllegalState Failed to load ApplicationCo
...
  AuthorResourceIntTest.updateNonExistingAuthor » IllegalState Failed to load Ap
...
  UserResourceIntTest.equalsVerifier » IllegalState Failed to load ApplicationCo
...
  UserResourceIntTest.testGetExistingUser » IllegalState Failed to load Applicat
...
  UserResourceIntTest.testGetUnknownUser » IllegalState Failed to load Applicati
...

Tests run: 41, Failures: 0, Errors: 38, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:53 min
[INFO] Finished at: 2017-03-18T10:12:54+07:00
[INFO] Final Memory: 54M/456M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
18.1:test (default-test) on project nsw-web: There are test failures.
[ERROR]
[ERROR] Please refer to G:\Learning\NSWWeb\target\surefire-reports for the indiv
idual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

1 个答案:

答案 0 :(得分:0)

您无法在JHI_USER中的用户或列中添加属性。使用其他方法是必要的。

在jhipster官方网站上关注此article