Spring JMS with Spring boot , Conflicting beans -


i creating spring jms listener spring boot, keep getting error:-

org.springframework.beans.factory.nouniquebeandefinitionexception: no qualifying bean of type [javax.jms.connectionfactory] defined: expected single matching bean found 3: queueconnectionfactory,queueconnectionfactoryextra,targetconnectionfactory     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:1126)     @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:1014)     @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:545) 

whereever read resolved using @qualifier annotation doesn't seem work me, please help. below class:-

@configuration public class listenercontainer{    @suppresswarnings("rawtypes") @qualifier("queueconnectionfactory") @bean(name="planlistenercontainerfactoryextra") public jmslistenercontainerfactory jmslistenercontainerfactory(@qualifier("queueconnectionfactory") connectionfactory queueconnectionfactory,@qualifier("queue") mqqueue queue, errorhandler errorhandler) {     defaultjmslistenercontainerfactory factory = new defaultjmslistenercontainerfactory();     factory.setconnectionfactory(queueconnectionfactory);     factory.seterrorhandler(errorhandler);      return factory; }     @qualifier("targetconnectionfactory") @bean(name="queueconnectionfactory") public connectionfactory queueconnectionfactory(@qualifier("targetconnectionfactory")  mqqueueconnectionfactory targetconnectionfactory) {     cachingconnectionfactory queueconnectionfactory = new cachingconnectionfactory();     ....     return queueconnectionfactory;  }  @bean(name="targetconnectionfactory") public mqqueueconnectionfactory targetconnectionfactory() {     mqqueueconnectionfactory targetconnectionfactory = new mqqueueconnectionfactory();      return targetconnectionfactory;  }  @bean(name="queue") public mqqueue queue() {     mqqueue queue = new mqqueue();     .....     return queue;  }  } 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -