These are chat archives for spring-cloud/spring-cloud

5th
Nov 2018
CH4:D
@chad_d_stud_twitter
Nov 05 2018 11:55

I’m getting this error on a working zuul service after upgrading to sb 2.1.0.RELEASE and cloud Finchley.SR2:


APPLICATION FAILED TO START


Description:

An attempt was made to call the method org.springframework.boot.autoconfigure.web.ServerProperties$Servlet.getServletPrefix()Ljava/lang/String; but it does not exist. Its class, org.springframework.boot.autoconfigure.web.ServerProperties$Servlet, is available from the following locations:

jar:file:/Users/user/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.1.0.RELEASE/8898af6accfab65ac6e232c1535abbc33cfa5fcb/spring-boot-autoconfigure-2.1.0.RELEASE.jar!/org/springframework/boot/autoconfigure/web/ServerProperties$Servlet.class

It was loaded from the following location:

file:/Users/user/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.1.0.RELEASE/8898af6accfab65ac6e232c1535abbc33cfa5fcb/spring-boot-autoconfigure-2.1.0.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.autoconfigure.web.ServerProperties$Servlet

Marcin Grzejszczak
@marcingrzejszczak
Nov 05 2018 12:16
Which version of boot do you use?
Ah
2.1.0 goes with Greenwich
Finchley doesn't work with 2.1
Eric Deandrea
@edeandrea
Nov 05 2018 12:44
What about spring-cloud-starter-config? Will Finchley work with boot 2.1?
CH4:D
@chad_d_stud_twitter
Nov 05 2018 13:11
okay i traced the issue with the ZuulProxy annotation
apparently 2.1.0 broke it
i commented out all the dependencies and gradually enabled them
having the zuul dependency declared doesn’t break it outright but having ZuulProxy used in the main class breaks my app
CH4:D
@chad_d_stud_twitter
Nov 05 2018 13:18
This is my build.gradle:
buildscript {
    ext {
        springBootVersion = '2.1.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
    id 'net.ltgt.apt' version '0.19'
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = ‘mygroup'
version = '2.0.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}


ext {
    springCloudVersion = 'Finchley.SR2'
}

dependencies {
    implementation('org.springframework.cloud:spring-cloud-starter-netflix-zuul')
    implementation('org.springframework.cloud:spring-cloud-starter-netflix-ribbon')
    implementation('org.springframework.boot:spring-boot-starter-thymeleaf')
    compileOnly('org.projectlombok:lombok:1.18.2')
    annotationProcessor('org.projectlombok:lombok:1.18.2')

    // Eureka
    implementation('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')

    // Config Server
    implementation("org.springframework.cloud:spring-cloud-config-client")

    implementation('org.springframework.boot:spring-boot-starter-actuator')

    implementation('org.springframework.cloud:spring-cloud-starter-openfeign')

    testImplementation('org.springframework.boot:spring-boot-starter-test')
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}
This is my Main class
@EnableDiscoveryClient
//@EnableZuulProxy
@EnableFeignClients
public class MainApplication {

    public static void main(String[] args) {
        SpringApplication.run(MainApplication, args);
    }
}
uncommenting EnableZuulProxy breaks things