Home > Mobile >  org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class cannot be opened
org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class cannot be opened

Time:03-14

I have this gradle configuration with the following dependencies:

plugins {
    id 'org.springframework.boot' version '2.6.4'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = '......'
version = '0.0.1'
sourceCompatibility = '11'

ext {
    set('springCloudVersion', "2021.0.1")
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
    implementation 'org.springframework.cloud:spring-cloud-starter-loadbalancer'
    implementation 'org.codehaus.jettison:jettison:1.4.1'
    implementation 'com.netflix.eureka:eureka-core'
    implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'javax.validation:validation-api'
    implementation 'org.hibernate.validator:hibernate-validator'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.threeten:threetenbp:1.5.1'
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'joda-time:joda-time:2.10.13'
    implementation 'org.springframework.security:spring-security-core'
    implementation 'org.apache.commons:commons-lang3:3.8.1'
    implementation 'org.apache.commons:commons-collections4:4.4'
    implementation 'org.json:json:20211205'
    implementation 'org.springframework.boot:spring-boot-starter-hateoas'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.13.1'
    implementation 'org.springframework.amqp:spring-amqp'
    implementation 'org.springframework.amqp:spring-rabbit'
    implementation 'io.jsonwebtoken:jjwt:0.9.1'
    implementation 'org.parboiled:parboiled-core:1.4.0'
    implementation 'commons-validator:commons-validator:1.7'
    implementation 'com.google.code.gson:gson:2.9.0'
    implementation 'org.springframework:spring-oxm'
    implementation 'org.springframework.ws:spring-ws-core'
    
    compileOnly 'org.projectlombok:lombok:1.18.22'
    annotationProcessor 'org.projectlombok:lombok:1.18.22'
    testCompileOnly 'org.projectlombok:lombok:1.18.22'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
    runtimeOnly 'org.postgresql:postgresql'

    implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

    implementation 'org.liquibase:liquibase-core'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

test {
    useJUnitPlatform()
}

When I start the application I get this error:

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist

Do you know what dependency should be added or some dependency is missing?

P.S

The problem comes form this dependency:

implementation 'org.springframework.cloud:spring-cloud-starter-hystrix:1.4.7.RELEASE'
implementation group: 'com.netflix.hystrix', name: 'hystrix-core', version: '1.5.18'

Do you know how I can fix it?

CodePudding user response:

I think you question has been already answered; please, consider review this SO question.

You need to include the following dependency:

implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.10.RELEASE'

Because you are using Spring BOM maybe this will be enough:

implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
  • Related