记录一个问题,微服务单体集成消息总线依赖,
org.springframework.cloud
spring-cloud-starter-bus-amqp
再次启动项目会出现如下错误信息:
17:32:21.796 spring-boot-logging [main] ERROR o.s.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:181)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.childdream.ChilddreamServiceApplication.main(ChilddreamServiceApplication.java:24)
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.stream.config.BindingServiceConfiguration] from ClassLoader [sun.misc.Launcher A p p C l a s s L o a d e r @ 18 b 4 a a c 2 ] a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 680 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . d o W i t h M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 577 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . d o W i t h M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 562 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t U n i q u e D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 620 ) a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p . c o m p u t e I f A b s e n t ( C o n c u r r e n t H a s h M a p . j a v a : 1660 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . g e t T y p e F o r F a c t o r y M e t h o d ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 721 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d e t e r m i n e T a r g e t T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 662 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p r e d i c t B e a n T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 630 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . i s F a c t o r y B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1491 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . i s F a c t o r y B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1014 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . a d d B e a n T y p e F o r N o n A l i a s D e f i n i t i o n ( B e a n T y p e R e g i s t r y . j a v a : 195 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . a d d B e a n T y p e F o r N o n A l i a s D e f i n i t i o n ( B e a n T y p e R e g i s t r y . j a v a : 159 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . a d d B e a n T y p e ( B e a n T y p e R e g i s t r y . j a v a : 152 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . u p d a t e T y p e s I f N e c e s s a r y ( B e a n T y p e R e g i s t r y . j a v a : 140 ) a t j a v a . u t i l . I t e r a t o r . f o r E a c h R e m a i n i n g ( I t e r a t o r . j a v a : 116 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . u p d a t e T y p e s I f N e c e s s a r y ( B e a n T y p e R e g i s t r y . j a v a : 135 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . B e a n T y p e R e g i s t r y . g e t N a m e s F o r T y p e ( B e a n T y p e R e g i s t r y . j a v a : 97 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . O n B e a n C o n d i t i o n . c o l l e c t B e a n N a m e s F o r T y p e ( O n B e a n C o n d i t i o n . j a v a : 298 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . O n B e a n C o n d i t i o n . g e t B e a n N a m e s F o r T y p e ( O n B e a n C o n d i t i o n . j a v a : 289 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . O n B e a n C o n d i t i o n . g e t B e a n N a m e s F o r T y p e ( O n B e a n C o n d i t i o n . j a v a : 278 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . O n B e a n C o n d i t i o n . g e t M a t c h i n g B e a n s ( O n B e a n C o n d i t i o n . j a v a : 189 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . O n B e a n C o n d i t i o n . g e t M a t c h O u t c o m e ( O n B e a n C o n d i t i o n . j a v a : 160 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . c o n d i t i o n . S p r i n g B o o t C o n d i t i o n . m a t c h e s ( S p r i n g B o o t C o n d i t i o n . j a v a : 47 ) . . . 17 c o m m o n f r a m e s o m i t t e d C a u s e d b y : j a v a . l a n g . N o C l a s s D e f F o u n d E r r o r : o r g / s p r i n g f r a m e w o r k / i n t e g r a t i o n / c o n f i g / H a n d l e r M e t h o d A r g u m e n t R e s o l v e r s H o l d e r a t j a v a . l a n g . C l a s s . g e t D e c l a r e d M e t h o d s 0 ( N a t i v e M e t h o d ) a t j a v a . l a n g . C l a s s . p r i v a t e G e t D e c l a r e d M e t h o d s ( C l a s s . j a v a : 2701 ) a t j a v a . l a n g . C l a s s . g e t D e c l a r e d M e t h o d s ( C l a s s . j a v a : 1975 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 662 ) . . . 39 c o m m o n f r a m e s o m i t t e d C a u s e d b y : j a v a . l a n g . C l a s s N o t F o u n d E x c e p t i o n : o r g . s p r i n g f r a m e w o r k . i n t e g r a t i o n . c o n f i g . H a n d l e r M e t h o d A r g u m e n t R e s o l v e r s H o l d e r a t j a v a . n e t . U R L C l a s s L o a d e r . f i n d C l a s s ( U R L C l a s s L o a d e r . j a v a : 382 ) a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( C l a s s L o a d e r . j a v a : 424 ) a t s u n . m i s c . L a u n c h e r AppClassLoader@18b4aac2] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562) at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1014) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:195) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:159) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:152) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:140) at java.util.Iterator.forEachRemaining(Iterator.java:116) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:135) at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:97) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:298) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:289) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:278) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:189) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:160) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ... 17 common frames omitted Caused by: java.lang.NoClassDefFoundError: org/springframework/integration/config/HandlerMethodArgumentResolversHolder at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662) ... 39 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.integration.config.HandlerMethodArgumentResolversHolder at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher AppClassLoader@18b4aac2]atorg.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)atorg.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)atorg.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)atorg.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620)atjava.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630)atorg.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491)atorg.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1014)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:195)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:159)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:152)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:140)atjava.util.Iterator.forEachRemaining(Iterator.java:116)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:135)atorg.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:97)atorg.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:298)atorg.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:289)atorg.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:278)atorg.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:189)atorg.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:160)atorg.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)...17commonframesomittedCausedby:java.lang.NoClassDefFoundError:org/springframework/integration/config/HandlerMethodArgumentResolversHolderatjava.lang.Class.getDeclaredMethods0(NativeMethod)atjava.lang.Class.privateGetDeclaredMethods(Class.java:2701)atjava.lang.Class.getDeclaredMethods(Class.java:1975)atorg.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662)...39commonframesomittedCausedby:java.lang.ClassNotFoundException:org.springframework.integration.config.HandlerMethodArgumentResolversHolderatjava.net.URLClassLoader.findClass(URLClassLoader.java:382)atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)atsun.misc.LauncherAppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 43 common frames omitted
17:32:21.797 spring-boot-logging [main] WARN o.s.boot.SpringApplication - Unable to close ApplicationContext
java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.stream.config.BindingServiceConfiguration] from ClassLoader [sun.misc.Launcher A p p C l a s s L o a d e r @ 18 b 4 a a c 2 ] a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 680 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . d o W i t h M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 577 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . d o W i t h M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 562 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t U n i q u e D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 620 ) a t j a v a . u t i l . c o n c u r r e n t . C o n c u r r e n t H a s h M a p . c o m p u t e I f A b s e n t ( C o n c u r r e n t H a s h M a p . j a v a : 1660 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . g e t T y p e F o r F a c t o r y M e t h o d ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 721 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d e t e r m i n e T a r g e t T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 662 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p r e d i c t B e a n T y p e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 630 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . i s F a c t o r y B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 1491 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . d o G e t B e a n N a m e s F o r T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 507 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n N a m e s F o r T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 477 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n s O f T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 598 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . g e t B e a n s O f T y p e ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 590 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . g e t B e a n s O f T y p e ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 1204 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . g e t E x i t C o d e F r o m M a p p e d E x c e p t i o n ( S p r i n g A p p l i c a t i o n . j a v a : 905 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . g e t E x i t C o d e F r o m E x c e p t i o n ( S p r i n g A p p l i c a t i o n . j a v a : 891 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . h a n d l e E x i t C o d e ( S p r i n g A p p l i c a t i o n . j a v a : 877 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . h a n d l e R u n F a i l u r e ( S p r i n g A p p l i c a t i o n . j a v a : 826 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 327 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1260 ) a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1248 ) a t c o m . c h i l d d r e a m . C h i l d d r e a m S e r v i c e A p p l i c a t i o n . m a i n ( C h i l d d r e a m S e r v i c e A p p l i c a t i o n . j a v a : 24 ) C a u s e d b y : j a v a . l a n g . N o C l a s s D e f F o u n d E r r o r : o r g / s p r i n g f r a m e w o r k / i n t e g r a t i o n / c o n f i g / H a n d l e r M e t h o d A r g u m e n t R e s o l v e r s H o l d e r a t j a v a . l a n g . C l a s s . g e t D e c l a r e d M e t h o d s 0 ( N a t i v e M e t h o d ) a t j a v a . l a n g . C l a s s . p r i v a t e G e t D e c l a r e d M e t h o d s ( C l a s s . j a v a : 2701 ) a t j a v a . l a n g . C l a s s . g e t D e c l a r e d M e t h o d s ( C l a s s . j a v a : 1975 ) a t o r g . s p r i n g f r a m e w o r k . u t i l . R e f l e c t i o n U t i l s . g e t D e c l a r e d M e t h o d s ( R e f l e c t i o n U t i l s . j a v a : 662 ) . . . 21 c o m m o n f r a m e s o m i t t e d C a u s e d b y : j a v a . l a n g . C l a s s N o t F o u n d E x c e p t i o n : o r g . s p r i n g f r a m e w o r k . i n t e g r a t i o n . c o n f i g . H a n d l e r M e t h o d A r g u m e n t R e s o l v e r s H o l d e r a t j a v a . n e t . U R L C l a s s L o a d e r . f i n d C l a s s ( U R L C l a s s L o a d e r . j a v a : 382 ) a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( C l a s s L o a d e r . j a v a : 424 ) a t s u n . m i s c . L a u n c h e r AppClassLoader@18b4aac2] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562) at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:507) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:598) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:590) at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1204) at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:905) at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:891) at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:877) at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:826) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) at com.childdream.ChilddreamServiceApplication.main(ChilddreamServiceApplication.java:24) Caused by: java.lang.NoClassDefFoundError: org/springframework/integration/config/HandlerMethodArgumentResolversHolder at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662) ... 21 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.integration.config.HandlerMethodArgumentResolversHolder at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher AppClassLoader@18b4aac2]atorg.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)atorg.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)atorg.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)atorg.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620)atjava.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630)atorg.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:507)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:598)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:590)atorg.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1204)atorg.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:905)atorg.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:891)atorg.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:877)atorg.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:826)atorg.springframework.boot.SpringApplication.run(SpringApplication.java:327)atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1260)atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1248)atcom.childdream.ChilddreamServiceApplication.main(ChilddreamServiceApplication.java:24)Causedby:java.lang.NoClassDefFoundError:org/springframework/integration/config/HandlerMethodArgumentResolversHolderatjava.lang.Class.getDeclaredMethods0(NativeMethod)atjava.lang.Class.privateGetDeclaredMethods(Class.java:2701)atjava.lang.Class.getDeclaredMethods(Class.java:1975)atorg.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662)...21commonframesomittedCausedby:java.lang.ClassNotFoundException:org.springframework.integration.config.HandlerMethodArgumentResolversHolderatjava.net.URLClassLoader.findClass(URLClassLoader.java:382)atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)atsun.misc.LauncherAppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 25 common frames omitted
上网也找了好多资料,错误原因是springcloud的版本与springboot版本不一致造成的。
springcloud与springboot的版本对应关系请参考 https://start.spring.io/actuator/info
我项目中springcloud版本是Finchley.SR2,springboot : 2.1.0.RELEASE
由于我这里使用的是springcloud : Finchley.SR2,该版本对应的springboot版本是Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT。所以我们将springboot降级版本即可。
没试过springcloud 升级能不能解决问题,有时间可以去试一下。