2014-06-13 74 views
0

我開始從頭開始編寫Spring Boot應用程序,並按照[http://spring.io/guides/gs/convert-jar-to-war/]中的描述對其進行配置。Spring啓動應用程序不會從Eclipse啓動,但可以從Cygwin工作

可以從Cygwin和Eclipse中運行它。 但是,當我試圖添加依賴項到我的gradle.build中的另一個項目時發生了問題。

我添加編譯(項目(「:my.another.project」))到依賴性節gradle.build並從該點是無法從Eclipse中運行它。但從cygwin一切正常。

我試圖將依賴項更改爲其他項目,但仍然存在相同的錯誤。當我刪除所有的依賴關係時,一切正常。

所以,基本上從Cygwin一切工作正常,它在Eclipse中失敗時項目有依賴到另一個項目。 你知道我的問題在哪裏嗎?

例外:

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot[email protected]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[email protected]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.s[email protected]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) 

回答

0

是否更改了Eclipse的元數據,當您添加額外的項目?您需要告訴Eclipse您的項目依賴於額外的項目(例如,如果您最初是這樣做的,則使用gradle cleanEclipse eclipse)。

+0

我試過了。不幸的是沒有幫助。有同樣的錯誤。 – user3737282

+0

我想你需要分享你的代碼,然後完成重現的步驟,因爲它看起來不像磨坊的任何東西(適用於其他人)。 –

相關問題