0
votes

I am getting following exceptions while running a spring boot 2.0.1 application with spring clould version Finchley.RC1 but works fine if I change the version to Finchley.M9 in pom.xml as:

        <spring-cloud.version>Finchley.RC1</spring-cloud.version>

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'propertySourceBootstrapConfiguration': Unsatisfied dependency expressed through field 'propertySourceLocators'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.company.configmanagement.springboot.autoconfig.CMBootstrapConfiguration$ConsulPropertySourceConfiguration': Unsatisfied dependency expressed through field 'configManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configManager' defined in com.company.configmanagement.springboot.autoconfig.ConfigManagementAutoConfiguration: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List; | AnnotationConfigApplicationContext:558

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'propertySourceBootstrapConfiguration': Unsatisfied dependency expressed through field 'propertySourceLocators'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.company.configmanagement.springboot.autoconfig.CMBootstrapConfiguration$ConsulPropertySourceConfiguration': Unsatisfied dependency expressed through field 'configManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configManager' defined in com.company.configmanagement.springboot.autoconfig.ConfigManagementAutoConfiguration: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;

1
Looks like some problem with the version of Guava that your application expects.spencergibb
@spencergibb Thanks for the pointer. I found that there was an internal dependency that was pulling in an old version for guava. Changing this version to 23.0 fixed the issue. But any recent versions like 25.0-jre do not work.Nitin S

1 Answers

0
votes

Looks like it was a version compatibility issue as an internal dependency was pulling guava version 14.0. For now, using the following version of dependency fixed the issue.

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>23.0</version>
    </dependency>