gpt4 book ai didi

eclipse - Spring Boot应用程序不会从Eclipse启动,但可以从Cygwin运行

转载 作者:行者123 更新时间:2023-12-03 06:21:37 25 4
gpt4 key购买 nike

我从头开始研究Spring Boot应用程序,并按照[http://spring.io/guides/gs/convert-jar-to-war/]上的描述]对其进行配置。

可以从Cygwin和Eclipse运行它。
但是,当我尝试向我的gradle.build中的另一个项目添加依赖项时,便出现了问题。

我已经在gradle.build的依赖项部分添加了compile(project(':my.another.project')),从那时开始,不可能从Eclipse运行它。但是从cygwin一切正常。

我试图将依赖关系更改为其他项目,但仍然存在相同的错误。当我删除所有依赖项时,一切正常。

因此,基本上从Cygwin来看,一切正常,当项目与另一个项目有依赖关系时,它将在Eclipse中失败。
您知道我可能在哪里出现问题吗?

异常(exception):

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@389cce04: startup date [Fri Jun 13 11:42:55 CEST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:152)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:329)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:909)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:898)
at eu.myapp.Application.main(Application.java:19)

2014-06-13 11:42:55.901 WARN 9408 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception thrown from LifecycleProcessor on context close

java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@389cce04: startup date [Fri Jun 13 11:42:55 CEST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:152)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:329)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:909)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:898)
at eu.myapp.Application.main(Application.java:19)

2014-06-13 11:42:55.902 INFO 9408 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4a0c85dc: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,application,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,helloController,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy
Exception in thread "main" java.lang.IllegalArgumentException: ResourceLoader must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.boot.autoconfigure.AutoConfigurationSorter.<init>(AutoConfigurationSorter.java:53)
at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.selectImports(EnableAutoConfigurationImportSelector.java:66)
at org.springframework.context.annotation.ConfigurationClassParser.processImport(ConfigurationClassParser.java:377)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:205)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:164)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:139)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:284)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:225)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:648)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:909)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:898)
at eu.myapp.Application.main(Application.java:19)

最佳答案

添加额外项目时是否更改了Eclipse元数据?您需要告诉Eclipse您的项目取决于额外的项目(例如,如果这是您最初的方式,请使用gradle cleanEclipse eclipse)。

关于eclipse - Spring Boot应用程序不会从Eclipse启动,但可以从Cygwin运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24202921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com