Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Spring Kafka 1.2.0.Relase.Jar、Spring-boot-starter 1.5.3和spring-messaging 4.2.0

Spring Kafka 1.2.0.Relase.Jar、Spring-boot-starter 1.5.3和spring-messaging 4.2.0
EN

Stack Overflow用户
提问于 2017-04-26 11:42:15
回答 2查看 432关注 0票数 0

我正在尝试运行spring-kafka集成。当我尝试启动Spring boot时,我得到下面的错误消息。根据上面的链接,4.3与Kafka 1.1 onwards.Has兼容任何人都尝试过这种组合。请记住,如果您使用spring-messaging (4.3版)代码将无法编译,并且Eclipse会抱怨maven config是

代码语言:javascript
运行
AI代码解释
复制
<dependency>
    <groupId>org.springframework.kafka</groupId>
    <artifactId>spring-kafka</artifactId>
    <version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-messaging</artifactId>
    <version>4.2.0.RELEASE</version>
    </dependency>
</dependency>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.3.RELEASE</version>
</parent>


I am trying to run below configuration to launch spring kafka.It is giving me below error when I launch SpringApplication through boot.
**Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-04-26 16:58:55.982 ERROR 10172 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed
java.lang.NoSuchMethodError: org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver.<init>(Lorg/springframework/messaging/converter/MessageConverter;)V
    at org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor$KafkaHandlerMethodFactoryAdapter.createDefaultMessageHandlerMethodFactory(KafkaListenerAnnotationBeanPostProcessor.java:654) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor$KafkaHandlerMethodFactoryAdapter.getMessageHandlerMethodFactory(KafkaListenerAnnotationBeanPostProcessor.java:630) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor$KafkaHandlerMethodFactoryAdapter.createInvocableHandlerMethod(KafkaListenerAnnotationBeanPostProcessor.java:625) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.MethodKafkaListenerEndpoint.configureListenerAdapter(MethodKafkaListenerEndpoint.java:112) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.MethodKafkaListenerEndpoint.createMessageListener(MethodKafkaListenerEndpoint.java:101) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.AbstractKafkaListenerEndpoint.setupMessageListener(AbstractKafkaListenerEndpoint.java:297) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.AbstractKafkaListenerEndpoint.setupListenerContainer(AbstractKafkaListenerEndpoint.java:282) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.AbstractKafkaListenerContainerFactory.createListenerContainer(AbstractKafkaListenerContainerFactory.java:211) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.AbstractKafkaListenerContainerFactory.createListenerContainer(AbstractKafkaListenerContainerFactory.java:46) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.KafkaListenerEndpointRegistry.createListenerContainer(KafkaListenerEndpointRegistry.java:182) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.KafkaListenerEndpointRegistry.registerListenerContainer(KafkaListenerEndpointRegistry.java:154) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.KafkaListenerEndpointRegistry.registerListenerContainer(KafkaListenerEndpointRegistry.java:128) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.KafkaListenerEndpointRegistrar.registerAllEndpoints(KafkaListenerEndpointRegistrar.java:138) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.config.KafkaListenerEndpointRegistrar.afterPropertiesSet(KafkaListenerEndpointRegistrar.java:132) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor.afterSingletonsInstantiated(KafkaListenerAnnotationBeanPostProcessor.java:224) ~[spring-kafka-1.2.0.RELEASE.jar:na]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:781) ~[spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at hello.Application.main(Application.java:12) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_60]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.3.RELEASE.jar:1.5.3.RELEASE]
2017-04-26 16:58:55.986  INFO 10172 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@704f3f3c: startup date [Wed Apr 26 16:58:46 IST 2017]; root of context hierarchy
2017-04-26 16:58:55.990  WARN 10172 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@704f3f3c: startup date [Wed Apr 26 16:58:46 IST 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:417) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1002) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:794) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at hello.Application.main(Application.java:12) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_60]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_60]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.3.RELEASE.jar:1.5.3.RELEASE]
2017-04-26 16:58:55.991  INFO 10172 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown**
EN

回答 2

Stack Overflow用户

发布于 2017-04-26 14:08:00

不敢相信这是错误的jar问题,无效的loc header.cleaned jar缓存,并且它再次构建maven并解决了这个问题

票数 0
EN

Stack Overflow用户

发布于 2017-06-10 17:07:58

Spring messaging删除了默认构造函数,因此根据您的版本,您可能会遇到此问题。升级到spring boot和messaging的最新版本,这个问题应该会得到解决

https://github.com/spring-projects/spring-framework/commit/c4fff6db1b5d35b65f01229fd057daab3bd730e2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43633214

复制
相关文章
了解spring-boot-starter
所有的spring-boot-starter都有约定俗成的默认配置,但允许我们调整这些配置以改变默认的配置行为,即“约定优先于配置”。
栗筝i
2022/12/01
6510
spring-boot-starter大力出奇迹
​  上篇文章我们已经聊了SpringBoot的启动过程中的各类扩展点,那么从http://start.spring.io上我们生成的demo项目中,到目前就剩下了maven工程的pom.xml还没有进行探索了,那么本文我们就来看看这里面到底都有啥,把大力出奇迹的常见spring-boot-starter来聊一聊,以便更好地使用SpringBoot.
阿豪聊干货
2018/08/09
9850
spring boot 起步依赖与传递依赖
org.springframework:spring-test 起步依赖:GroupId :org.springframework.boot 传递依赖
小小明童鞋
2019/03/12
1.8K0
自己实现一个spring-boot-starter
additional-spring-configuration-metadata.json(位置同上)
用户1215919
2021/12/28
2640
CVE-2018-1270 Remote Code Execution with spring-messaging
Spring Framework通过spring-messageing模块和STOMP代理对象通讯。根据漏洞描述可以知漏洞出现在spring-message模块 或者是 stomp-websockets模板块,下面逐一分析:
逍遥子大表哥
2021/12/17
4170
深入浅析Spring-boot-starter常用依赖模块
2.针对日常企业应用研发各种场景的Spring-boot-starter自动配置依赖模块,且“开箱即用”(约定spring-boot-starter- 作为命名前缀,都位于org.springframenwork.boot包或者命名空间下)。
技术zhai
2019/02/28
1.7K0
Spring for Apache Kafka 3.0 和 Spring for RabbitMQ 3.0 发布
作者 | Johan Janssen 译者 | 明知山 策划 | 丁晓昀   VMWare 发布 Spring for Apache Kafka 3.0 和 Spring for RabbitMQ 3.0,需要 Java 17 和 Spring Framework 6.0。这些项目现在支持创建原生 GraalVM 应用程序,并使用 Micrometer 指标门面来观察计时器和实现跟踪。现在,两个项目都在 pom.xml 文件中提供了 BOM,方便进行依赖项管理。 Micrometer 用于增强 JV
深度学习与Python
2023/03/29
7660
Spring for Apache Kafka 3.0 和 Spring for RabbitMQ 3.0 发布
SpringBoot魔法堂:说说带智能提示的spring-boot-starter
前几个月和隔壁组的老王闲聊,他说项目的供应商离职率居高不下,最近还有开发刚接手ESB订阅发布接口才两周就提出离职,而他能做的就只有苦笑和默默地接过这个烂摊子了。 而然幸福的家庭总是相似的,而不幸的我却因业务变革走上了和老王一样的道路。单单是接口的开发居然能迫使一位开发毅然决然地离职,我既不相信是人性的扭曲,更不信是道德的沦丧。 抛开这个富有色彩的故事而言,我发现原来的项目存在如下问题:
^_^肥仔John
2020/11/13
5160
Yum安装Zabbix4.2.0
时间:2019-04-09 18:27:53      阅读:824      评论:0      收藏:0      [点我收藏+]
拓荒者
2019/08/12
1K0
「Spring和Kafka」如何在您的Spring启动应用程序中使用Kafka
在架构规划期间选择正确的消息传递系统始终是一个挑战,但这是需要确定的最重要的考虑因素之一。作为一名开发人员,我每天都要编写需要服务大量用户并实时处理大量数据的应用程序。
架构师研究会
2020/12/08
1.7K0
「Spring和Kafka」如何在您的Spring启动应用程序中使用Kafka
​玩转Kafka—Spring整合Kafka
参考文章:https://www.cnblogs.com/angelyan/p/10800739.html
闫同学
2022/10/31
8520
​玩转Kafka—Spring整合Kafka
spring集成kafka
一、添加依赖项 compile 'org.springframework.kafka:spring-kafka:1.2.2.RELEASE' 二、发消息(生产者) 2.1 xml配置 1 <?xml
菩提树下的杨过
2018/01/18
7770
SpringBoot 2.0 + Apache Dubbo 2.7.3 最新版整合方案
2018年2月16日,Apache Dubbo 加入 Apache 基金会孵化器。2019年5月16日,Apache 软件基金会董事会决议通过了 Apache Dubbo 的毕业申请,这意味着 Apache Dubbo 正式成为 Apache 的顶级项目。
小柒2012
2019/12/05
1.9K0
Spring Boot 集成 Kafka
消息通信有两种基本模型,即发布-订阅(Pub-Sub)模型和点对点(Point to Point)模型,发布-订阅支持生产者消费者之间的一对多关系,而点对点模型中有且仅有一个消费者。
微观技术
2021/04/19
2.6K0
Spring Boot 集成 Kafka
Spring boot with Apache Kafka
本文节选自电子书《Netkiller Java 手札》 5.21. Spring boot with Apache Kafka Spring boot 1.5.1 5.21.1. 安装 kafka 一下安装仅仅适合开发环境,生产环境请使用这个脚本安装 https://github.com/oscm/shell/tree/master/mq/kafka cd /usr/local/src wget http://apache.communilink.net/kafka/0.10.2.0/kafka_2.12-
netkiller old
2018/03/05
1.2K0
spring boot整合kafka
最近项目需求用到了kafka信息中间件,在此做一次简单的记录,方便以后其它项目用到。
GreizLiao
2019/09/24
6330
微服务架构-SpringBoot2.0.3源码之web容器篇(一)
SpringBoot高度模块化,特别适合需要高度模块化的业务项目,SpringBoot整体设计思路就是简单、高效、剥离组件、省代码。
35岁程序员那些事
2020/02/24
7280
从apollo的初始化看spring boot 1.5.3启动过程( 一)
其实,每次寻找都会全盘加载,然后再选取某一类型的,个人理解,这样会造成多次IO读写,可采用使用map一次IO读取,然后缓存后,多次使用。
MickyInvQ
2020/09/27
6850
从apollo的初始化看spring boot 1.5.3启动过程( 一)
CVE-2018-1270&CVE-2018-1275 spring-messaging远程代码执行漏洞分析
漏洞描述 Spring框架版本5.0-5.0.4,4.3-4.3.15存在CVE-2018-1270和CVE-2018-1275漏洞可导致远程代码执行。在引入且使用spring-messaging组件时,攻击者可通过WebSocket向服务器端发送携带有恶意代码的STOMP消息,从而导致远程代码执行攻击。 注意由于可能官方版本发布流程或代码管理上所犯低级错误,导致4.3.14-4.3.15版本升级中该漏洞所涉及文件并未更新,所以CVE-2018-1270在4.3.14版本中并未修复,就有了最新的CVE-20
风流
2018/06/01
3.2K0
三分钟学会自定义spring-boot-starter
传统的 Maven项目一般将需要被复用的组件做成 Module来进行管理,以便二次调用;而在 Spring Boot项目中我们则可以使用更加优雅的 Spring Boot Starter来完成这一切。
java技术爱好者
2020/09/22
8060
三分钟学会自定义spring-boot-starter

相似问题

spring-boot-starter web和spring-boot-starter web-services和spring-boot-starter的区别

13

spring-boot-starter tomcat vs spring-boot-starter web

26

REST的spring-boot-starter web和spring-boot-starter data-REST的差异

10

spring-boot-starter找不到bean

110

Wicket 1.5.3的Spring依赖项

30
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
社区富文本编辑器全新改版!诚邀体验~
全新交互,全新视觉,新增快捷键、悬浮工具栏、高亮块等功能并同时优化现有功能,全面提升创作效率和体验
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文