eureka server in Gradle Projekt kann Methoden nicht finden

8u3631984

Bekanntes Mitglied
Hallo ich habe ein kleines Gradle Projekt in dem ich ein Eureka Server in einem . Hier ist mein Setup :
Java:
dependencies {
    implementation 'org.springframework.cloud:spring-cloud-starter-eureka-server:+'
    }

Hier die Main Class :
Code:
@SpringBootApplication
@EnableEurekaServer
public class EurekaServer {

    public static void main(String[] args) {
        SpringApplication.run(EurekaServer.class, args);
    }
}

Wenn ich nun die Main Class starten erhalte ich folgenden Fehler :
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)

The following method did not exist:

'void org.springframework.boot.builder.SpringApplicationBuilder.<init>(java.lang.Object[])'

Kann mir jemand heflen.
Vielen Dank
 
Du solltest eine versions Nummer angeben nicht nur +
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:2.2.0.RELEASE'

Java:
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka-server
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka-server', version: '1.4.7.RELEASE'
 
Zuletzt bearbeitet:
Danke für deine schnelle Antwort.
Mir ist aufgefallen, dass ich die falsche Dependency verwendet habe.
ich habe mal die Version verwendet :
Java:
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:3.1.1'

Nun erhalte ich folgenden Fehler :
Java:
***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration$StandardGsonBuilderCustomizer.customize(GsonAutoConfiguration.java:90)

The following method did not exist:

    'com.google.gson.GsonBuilder com.google.gson.GsonBuilder.setLenient()'
 
Java:
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka-server
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka-server', version: '1.4.7.RELEASE'
 
The following method did not exist: 'com.google.gson.GsonBuilder com.google.gson.GsonBuilder.setLenient()'
Das hört sich ggf nach einer falschen oder fehlenden gson Version an. Aber GSonBuilder hat setLenient in den letzten Versionen ... also 2.9.0, 2.8.5 ... da ist das immer vorhanden. Alles über 2.5 dürfte das haben meine ich.
 
Also ich habe nun die GSon Abhängigkeit hinzugefügt und nun geht es :
Java:
    implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:+'
    implementation 'com.google.code.gson:gson:+'

Vielen Dank für die Unterstützung
 

Zurück
Oben