打成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]
2017-07-02
感覺提問與報錯不符。提問說的是打成jar包就無法執行了,言外之意了不打包可以執行是吧?從報錯的情況來看是maven依賴的jar包未找到,按理來說依賴的jar包未找到根本無法執行的。建議:
1,同步pom文件,讓它重新加載所需依賴
2,重新進行clean ?install操作
3,打成可執行jar要指定main方法。打成被第三方依賴的jar包可以無需指定main方法