为了账号安全,请及时绑定邮箱和手机立即绑定

spring cloud stream 使用 rabbitMQ 启动报错?

spring cloud stream 使用 rabbitMQ 启动报错?

宗恣 2018-08-02 11:23:03
报错信息:org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'myMessage' defined in com.canvas.order.message.StreamClient: bean definition with this name already exists - Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.canvas.order.message.StreamClient; factoryMethodName=output; initMethodName=null; destroyMethodName=null at org.springframework.cloud.stream.binding.BindingBeanDefinitionRegistryUtils.registerBindingTargetBeanDefinition(BindingBeanDefinitionRegistryUtils.java:64) ~[spring-cloud-stream-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.stream.binding.BindingBeanDefinitionRegistryUtils.registerInputBindingTargetBeanDefinition(BindingBeanDefinitionRegistryUtils.java:47) ~[spring-cloud-stream-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.stream.binding.BindingBeanDefinitionRegistryUtils.lambda$registerBindingTargetBeanDefinitions$0(BindingBeanDefinitionRegistryUtils.java:80) ~[spring-cloud-stream-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.stream.binding.BindingBeanDefinitionRegistryUtils$$Lambda$284/4009390.doWith(Unknown Source) ~[na:na] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:541) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.cloud.stream.binding.BindingBeanDefinitionRegistryUtils.registerBindingTargetBeanDefinitions(BindingBeanDefinitionRegistryUtils.java:76) ~[spring-cloud-stream-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.stream.config.BindingBeansRegistrar.registerBeanDefinitions(BindingBeansRegistrar.java:45) ~[spring-cloud-stream-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:358) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$$Lambda$168/16845808.accept(Unknown Source) ~[na:na] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:676) ~[na:1.8.0_45] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:357) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:145) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at com.canvas.order.OrderApplication.main(OrderApplication.java:14) [classes/:na]com.canvas.order.message.StreamClient    类:    public interface StreamClient {     @Input("myMessage")     SubscribableChannel input();     @Output("myMessage")     MessageChannel output(); }
查看完整描述

3 回答

?
Nomo_Air

TA贡献8条经验 获得超10个赞


@Input,@Output 不可一样。

https://img1.sycdn.imooc.com//5b7e7e6700019d6403980305.jpg

https://img1.sycdn.imooc.com//5b7e7e170001140d05330368.jpg

查看完整回答
6 反对 回复 2018-08-23
  • 慕侠326523
    慕侠326523
    谢谢...按照你写的搞好了...
  • 由俭入奢易
    由俭入奢易
    同一个服务里面的信道名字不能一样,在不同的服务里可以相同名字的信道
  • 金色年华ch
    金色年华ch
    你用的spring-cloud-version 和 spring-boot 版本是啥,我按照你的写法rabbitMQ好像没有接收到消息,StreamReceiver里面加断点也没进去 我的spring-boot 版本:2.0.6.RELEASE spring-cloud版本:Finchley.SR2
点击展开后面1
?
qq_燃_10

TA贡献1条经验 获得超1个赞

我也是这样

查看完整回答
1 反对 回复 2018-08-09
?
24match

TA贡献1条经验 获得超0个赞

没有导入aopalliance-1.0.jar和aspectjweaver-1.8.7.jar

查看完整回答
反对 回复 2018-08-21
  • 3 回答
  • 1 关注
  • 5969 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信