• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Defining the bean in spring context file

 
Ranch Hand
Posts: 647
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I want to understand how to define a bean of type below in spring config file. This is Auto wired.

@Autowired
@Qualifier("tvrrmImportQueueProcessor")
private Map<String, DefaultMessageListenerContainer> tvrrmQueueProcessors;

But when I try to run my application I get below error:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Map com.theice.tradevault.tradecollector.config.TvrrmImportAppJmxConfiguration.tvrrmImportQueueProcessors; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jms.listener.DefaultMessageListenerContainer] found for dependency [map with value type org.springframework.jms.listener.DefaultMessageListenerContainer]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=tvrrmImportQueueProcessor)}


I have declared the bean as below in spring config.

<bean id="tvrrmImportQueueProcessor" class="java.util.HashMap"/>


thanks
Trupti


 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guessing, the problem is with your declaration
try changing private Map<String, DefaultMessageListenerContainer> tvrrmQueueProcessors to private Map<String, DefaultMessageListenerContainer> tvrrmImportQueueProcessor
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic