gpt4 book ai didi

java.lang.NoSuchMethodError : org. springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Object;)V

转载 作者:行者123 更新时间:2023-12-03 21:01:14 24 4
gpt4 key购买 nike

我正在编写简单的应用程序以熟悉 spring 批处理。我想学习 spring 批处理管理,但我发现它已被弃用,所以我必须改用 spring 云数据流。

我找到了一个关于 spring 云数据的教程,并做了第一步:

  • 添加依赖:

    编译(“org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE”)
  • 并用 additioanl annotaion 标记我的 Spring Boot 应用程序类:

    @EnableDataFlowServer

  • 现在我正在尝试使用idea运行它,但它会打印:
    10:24:09.590 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
    java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
    at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
    at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:340)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
    at spring.boot.hello.world.MyApplication.main(MyApplication.java:11)

    最佳答案

    在大多数情况下,这要么是由于缺少依赖项,要么是由于较旧的 spring/spring boot 版本附带的依赖项。
    检查您的 maven 依赖树并搜索比您的父启动器请求的版本更旧的 spring-boot 依赖项。大概 org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE带有旧版本,您需要将其排除。

    关于java.lang.NoSuchMethodError : org. springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57426529/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com