我有一个属性文件,其中包含队列,其值为queue_name
如果我在其他请使用该属性,那么它可以工作,但如果我在“id”上使用它,那么它会失败
<rabbit:queue id="${queue}" name="queue" />
错误是
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.amqp.rabbit.config.BindingFactoryBean#0': Cannot resolve reference to bean 'queue_name' while setting bean property 'destinationQueue'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ConnectorInputQueue_silo' is defined.
更新:
我发现了以下日志:它说bean ${queue}已创建,那么为什么它不将${queue}替换为“queue”属性的值呢?
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:220 - Creating shared instance of singleton bean '${queue}'
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:450 - Creating instance of bean '${queue}'
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:524 - Eagerly caching bean '${queue}' to allow for resolving potential circular references
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:478 - Finished creating instance of bean '${queue}'
请显示更多信息以重现该问题。并注意你的 StackTrace 说:
未定义名为“ConnectorInputQueue_silo”的 bean。
也许它会以某种方式帮助你......
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)