Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在jhipster中更新实体时,正确的解决方法是什么?_Java_Spring_Maven_Jhipster - Fatal编程技术网

Java 在jhipster中更新实体时,正确的解决方法是什么?

Java 在jhipster中更新实体时,正确的解决方法是什么?,java,spring,maven,jhipster,Java,Spring,Maven,Jhipster,我有一个modelio UML类模型。我一直在更新它,之后我运行jhipster uml.xmi来重新生成实体。我总是收到错误信息。我试图从-jhipster文件中删除entity.json文件,但没有帮助。那么,您能告诉我在开发过程中更新实体的正确解决方法是什么吗?我也尝试运行maven:diff任务,但没有成功 编辑: 我创建了一个新的jhipster应用程序,并从modelio UML类模型中创建了实体。一切正常。然后,我只在模型中添加了一个属性,并从xmi文件中重新生成实体,所有操作系统

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

编辑:

我创建了一个新的jhipster应用程序,并从modelio UML类模型中创建了实体。一切正常。然后,我只在模型中添加了一个属性,并从xmi文件中重新生成实体,所有操作系统都再次被破坏

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

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

部分错误:

[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
[DEBUG]com.acontrol.config.DatabaseConfiguration-配置数据源
[调试]com.acontrol.config.DatabaseConfiguration-配置Liquibase
[错误]org.springframework.boot.context.embedded.tomcat.TomcatStarter-启动tomcat上下文时出错:org.springframework.beans.factory.BeanCreationException
[警告]org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext-上下文初始化期间遇到异常-取消刷新尝试
org.springframework.context.ApplicationContextException:无法启动嵌入式容器;嵌套异常为org.springframework.boot.context.embedded.EmbeddedServletContainerException:无法启动嵌入式Tomcat
位于org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在org.springframework.boot.SpringApplication.run(SpringApplication.java:320)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在com.acontrol.Application.main(Application.java:72)[classes/:na]
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)~[na:1.8.0\u 05]
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)~[na:1.8.0\u 05]
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.8.0\u 05]
在java.lang.reflect.Method.invoke(Method.java:483)~[na:1.8.0\u 05]
在com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)[idea\u rt.jar:na]
原因:org.springframework.boot.context.embedded.EmbeddedServletContainerException:无法启动嵌入式Tomcat
在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:98)~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
位于org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.(TomcatEmbeddedServletContainer.java:75)~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.gettomcatembeddedservletContainerContainer(TomcatEmbeddedServletContainerFactory.java:378)~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.GetEmbeddedServletContainerFactory(TomcatEmbeddedServletContainerFactory.java:155)~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
位于org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
位于org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
... 省略10个公共框架
原因:org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration”的bean时出错:自动关联依赖项的注入失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:无法自动连线方法:public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.SetFilterChainProxy SecurityConfigure(org.springframework.security.config.annotation.ObjectPostProcessor,java.util.List)抛出java.lang.Exception;嵌套异常为org.springframework.beans.factory.BeanExpressionException:表达式解析失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“securityConfiguration”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:无法自动关联字段:private org.springframework.security.core.userdetails.userdetails服务com.acontrol.config.SecurityConfiguration.userdetails服务;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“userDetailsService”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:无法自动连接字段:private com.acontrol.repository.UserRepository com.acontrol.security.UserDetailsService.UserRepository;嵌套异常为org.springframework.beans.factory.beancreatitionException:创建名为“userRepository”的bean时出错:无法创建内部bean(内部bean)#5
task liquibaseClearChecksums(dependsOn: compileJava, type: JavaExec) {
    group = "liquibase"

    classpath sourceSets.main.runtimeClasspath
    classpath configurations.liquibase
    main = "liquibase.integration.commandline.Main"

    args "--changeLogFile=src/main/resources/config/liquibase/changelog/" + buildTimestamp() +"_changelog.xml"
    args "--referenceUrl=hibernate:spring:com.asimplemodule.deptmanager.domain?dialect=com.asimplemodule.deptmanager.domain.util.FixedPostgreSQL82Dialect&hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy"
    args "--username=mycoolapp"
    args "--password=mycoolapp"
    args "--url=jdbc:postgresql://localhost:5432/mycoolApp"
    args "--driver=org.postgresql.Driver"
    args "clearChecksums"

}