springboot 集成apollo错误问题

Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer
    at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:465)
    at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:444)
    at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:435)
    at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:271)
    at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:252)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265)
    at cn.creditu.SsoServiceApplication.main(SsoServiceApplication.java:16)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer]: Constructor threw exception; nested exception is com.ctrip.framework.apollo.exceptions.ApolloConfigException: Unable to load instance for com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory!
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:182)
    at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:461)
    ... 7 more
Caused by: com.ctrip.framework.apollo.exceptions.ApolloConfigException: Unable to load instance for com.ctrip.framework.apollo.spring.config.ConfigPropertySourceFactory!
    at com.ctrip.framework.apollo.spring.util.SpringInjector.getInstance(SpringInjector.java:40)
    at com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer.<init>(ApolloApplicationContextInitializer.java:66)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.__newInstance(DelegatingConstructorAccessorImpl.java:45)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45009)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45012)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
    ... 8 more
Caused by: com.ctrip.framework.apollo.exceptions.ApolloConfigException: Unable to initialize Apollo Spring Injector!
    at com.ctrip.framework.apollo.spring.util.SpringInjector.getInjector(SpringInjector.java:24)
    at com.ctrip.framework.apollo.spring.util.SpringInjector.getInstance(SpringInjector.java:37)
    ... 16 more
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Maps.newConcurrentMap()Ljava/util/concurrent/ConcurrentMap;
    at com.google.inject.internal.SingletonScope.<clinit>(SingletonScope.java:106)
    at com.google.inject.Scopes.<clinit>(Scopes.java:39)
    at com.google.inject.internal.InjectorShell$RootModule.configure(InjectorShell.java:294)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
    at com.google.inject.spi.Elements.getElements(Elements.java:110)
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
    at com.google.inject.Guice.jrCreateInjector(Guice.java:99)
    at com.google.inject.Guice.createInjector(Guice.java:40001)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at com.ctrip.framework.apollo.spring.util.SpringInjector.getInjector(SpringInjector.java:22)
    ... 17 more

原因:

apollo-client中guava-16.0.1.jar和google-collections-1.0.jar 包冲突

 

 
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值