Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/323.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 Eclipse Spring启动-在TransactionAutoConfiguration和Neo4jDataAutoConfiguration之间检测到自动配置周期_Java_Spring_Eclipse_Spring Boot - Fatal编程技术网

Java Eclipse Spring启动-在TransactionAutoConfiguration和Neo4jDataAutoConfiguration之间检测到自动配置周期

Java Eclipse Spring启动-在TransactionAutoConfiguration和Neo4jDataAutoConfiguration之间检测到自动配置周期,java,spring,eclipse,spring-boot,Java,Spring,Eclipse,Spring Boot,从昨天开始,我在开发1.5.2.0版本的Spring Boot应用程序时遇到了一个非常奇怪的错误。在Eclipse中运行项目时,我开始出现以下异常 从命令行运行它时,一切正常,但在开发和调试时,我仍然需要从Eclipse运行它。我尝试过,重新导入项目,在Eclipse中清理它们,但错误依然存在 2017-12-05 13:46:45.620 ERROR 11048 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : D

从昨天开始,我在开发1.5.2.0版本的Spring Boot应用程序时遇到了一个非常奇怪的错误。在Eclipse中运行项目时,我开始出现以下异常

从命令行运行它时,一切正常,但在开发和调试时,我仍然需要从Eclipse运行它。我尝试过,重新导入项目,在Eclipse中清理它们,但错误依然存在

2017-12-05 13:46:45.620 ERROR 11048 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@744ed1b7: startup date [Tue Dec 05 13:46:43 EET 2017]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:404) [spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]

<STACK-TRACE>

2017-12-05 13:46:45.635 ERROR 11048 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.almetis.webraadmin.WebRaAdminApplication];
nested exception is java.lang.IllegalStateException: AutoConfigure cycle detected between org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration and org.springframework.boot.autoconfigure.data.neo4j.Neo4jDataAutoConfiguration  
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:545) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]

<STACK-TRACE>

Caused by: java.lang.IllegalStateException: AutoConfigure cycle detected between org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration and org.springframework.boot.autoconfigure.data.neo4j.Neo4jDataAutoConfiguration   
at org.springframework.util.Assert.state(Assert.java:70) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE]

在升级我的主项目和库以使用SpringBoot1.5.8.RELEASE之后,我可以在Eclipse中再次运行我的应用程序

1.5.2.0版本与Neo4J的集成似乎存在问题,请参见github和

在仔细观察之后,我发现了原因:我的主要应用程序使用的是SpringBoot1.5.2,它使用的一个库使用的是SpringBoot1.5.8

在试用了我的库和主应用程序的Spring Boot版本后,我看到:

如果所有库和主应用程序都使用Spring Boot 1.5.2,那么一切都可以正常工作 如果所有库和主应用程序都使用Spring Boot 1.5.8,那么一切都可以正常工作

如果库使用SpringBoot1.5.8,而主应用程序使用SpringBoot1.5.2,则会抛出问题中的异常

至少可以说,这个错误有点神秘,但主要的好处是将所有库和应用程序保持在相同的Spring启动版本上