在jhipster中更新实体时正确的解决方法是什么? [英] What is correct workaround when updating entities in jhipster?

查看:95
本文介绍了在jhipster中更新实体时正确的解决方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Modelio UML类模型.我一直都在更新它,之后我运行jhipster-uml .xmi来重新生成实体.我总是收到错误消息.我试图从-jhipster文件中删除entity.json文件,但这无济于事.那么,您能告诉我什么是在开发过程中更新实体的正确解决方法吗?我也尝试运行maven:diff任务,但是没有运气.

I have a modelio UML class model. I have been updating it all the time and after that I run jhipster-uml .xmi to regenerate entities. I always ended up to error messages. I tried to delete from -jhipster files the entity.json files but it doesn't help. So could you tell me what is correct workaround to update entities during the development? I tried to run maven:diff task as well, but no luck.

我创建了一个新的jhipster应用程序,并从modelio UML类模型创建了实体.一切正常.然后,我只向模型添加了一个属性,并从xmi-file重新生成了实体,并且所有操作都再次中断.

I created a new jhipster app and created entities from modelio UML class model. Everything is working fine. Then I just added one attribute to my model and regenerate the entity from xmi-file and everything os broken again.

我的工作流程是: 1)将UML模型另存为XMI文件 2)运行jhipster-uml ac2.xmi -paginate 3)在intellijIdea中编译我的应用 4)运行maven任务:mvn编译liquibase:diff创建一个新的变更日志 5)运行应用程序 6)观看错误消息:

My workflow was: 1) save uml model as xmi-file 2) Run jhipster-uml ac2.xmi -paginate 3) Compile my app in intellijIdea 4) run maven task: mvn compile liquibase:diff to create a new changelog 5) run application 6) Watch the error messages:

1 change sets check sum
      classpath:config/liquibase/changelog/20150828220237_added_entity_Employee.xml::20150828220237::jhipster is now: 7:dd10f74a01a95b4e48c592e796a1d352


部分错误:


Part of the error:

[DEBUG] com.acontrol.config.DatabaseConfiguration - Configuring Datasource
[DEBUG] com.acontrol.config.DatabaseConfiguration - Configuring Liquibase
[ERROR] org.springframework.boot.context.embedded.tomcat.TomcatStarter - Error starting Tomcat context: org.springframework.beans.factory.BeanCreationException
[WARN] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at com.acontrol.Application.main(Application.java:72) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
    at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) [idea_rt.jar:na]
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:98) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:75) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:378) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:155) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) [spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    ... 10 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.setFilterChainProxySecurityConfigurer(org.springframework.security.config.annotation.ObjectPostProcessor,java.util.List) throws java.lang.Exception; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.core.userdetails.UserDetailsService com.acontrol.config.SecurityConfiguration.userDetailsService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.acontrol.repository.UserRepository com.acontrol.security.UserDetailsService.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#5550ca83' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5550ca83': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[s

推荐答案

当我想重新生成我的所有表时,我会这样做

When I want to regenerate all my tables I do this

  1. 在MODELIO中更新模型
  2. 重新导出xmi
  3. rm -rf ./.jhipster/
  4. 打开文件src/main/resources/config/liquibase/master.xml并删除除<include>之外的所有<include>元素
    • config/liquibase/changelog/00000000000000_initial_schema.xml
    • 评论"JHipster将在此处添加liquibase更改日志"
  1. Update the model in MODELIO
  2. Re-export the xmi
  3. rm -rf ./.jhipster/
  4. Open file src/main/resources/config/liquibase/master.xml and remove all <include> elements except
    • config/liquibase/changelog/00000000000000_initial_schema.xml, and
    • The comment "JHipster will add liquibase changelogs here"

这篇关于在jhipster中更新实体时正确的解决方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆