我正在写一个简单的应用程序来熟悉Spring批处理。我想学习Spring批处理管理,但我发现它被弃用了,所以我不得不使用Spring云数据流代替。
我找到了一个关于spring cloud data的教程,并做了第一步:
1.添加的依赖项:
编译(“org.springframework.cloud:spring-cloud-starter-数据流-服务器-本地:1.7.4.RELEASE”)
1.并用附加注解标记了我的Sping Boot 应用程序类:
@启用数据流服务器
现在,我尝试使用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)
1条答案
按热度按时间fwzugrvs1#
在大多数情况下,这是由于缺少依赖项或依赖项来自较旧的spring/spring Boot 版本。检查您的maven依赖项树并搜索比您的父启动器请求的版本更旧的spring-boot依赖项。可能
org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE
附带了较旧的版本,您需要将其排除。