亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

打成jar包就沒法運行了咋回事啊?

2017-06-30 14:08:07.720 ERROR 9840 --- [ ? ? ? ? ? main] o.s.b.f.s.DefaultListableBeanFactory ? ? : Destroy method on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' threw an exception

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@514713: startup date [Fri Jun 30 14:08:03 CST 2017]; root of context hierarchy

? ? ? ? at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414) [spring-context-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97) ~[spring-context-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253) ~[spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) [spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961) [spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) [spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968) [spring-beans-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030) [spring-context-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556) [spring-context-4.3.9.RELEASE.jar!/:4.3.9.RELEASE]

? ? ? ? at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.4.RELEASE.jar!/:1.5.4.RELEASE]

正在回答

2 回答

感覺提問與報錯不符。提問說的是打成jar包就無法執行了,言外之意了不打包可以執行是吧?從報錯的情況來看是maven依賴的jar包未找到,按理來說依賴的jar包未找到根本無法執行的。建議:

1,同步pom文件,讓它重新加載所需依賴

2,重新進行clean ?install操作

3,打成可執行jar要指定main方法。打成被第三方依賴的jar包可以無需指定main方法

0 回復 有任何疑惑可以回復我~
#1

必修一_04381419 提問者

在項目目錄下使用mvn spring-boot:run可以運行,打成jar包運行就報錯,沒有main方法的話會提示“沒有主清單屬性,找不到或者無法加載主類等等”,pom文件里除了springboot依賴還需要其他哪些插件???
2017-07-06 回復 有任何疑惑可以回復我~

java -jar +文件名去執行jar包

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
2小時學會Spring Boot
  • 參與學習       151526    人
  • 解答問題       1132    個

Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序

進入課程

打成jar包就沒法運行了咋回事啊?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號