spring cloud feign 启动报错 java.lang.ClassNotFoundException: org.springframework.cloud.client.loadbalan

spring cloud feign 启动报错 java.lang.ClassNotFoundException: org.springframework.cloud.client.loadbalancer.LoadBalancedRetryFactory

Caused by: java.lang.NoClassDefFoundError: org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_181]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_181]
	at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_181]
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) ~[spring-core-5.0.0.RC3.jar:5.0.0.RC3]
	... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.client.loadbalancer.LoadBalancedRetryFactory
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_181]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_181]
	... 24 common frames omitted

第一反应就是jar包不完整.然后各种百度,Google,都没有解决问题.心里难受提供springboot版本和springcloud对应版本,原来:
springBootVersion = ‘2.0.0.M3’
springCloudVersion = ‘Finchley.M2’


			org.springframework.cloud
			spring-cloud-starter-openfeign

Maven默认下载的是2.0.0.M2版本.源码中是没有LoadBalancedRetryFactory
网上都说版本有问题,楼主各种试,试得我脑壳大.
解决:


			org.springframework.cloud
			spring-cloud-starter-openfeign
			2.0.0.M3

希望能帮助到各位.共勉!!!

你可能感兴趣的:(SpringCloud,Feign)