Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6104103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:48:14+00:00 2026-05-23T13:48:14+00:00

I have the following scenario: class A with bean-a in wireup.xml class B extends

  • 0

I have the following scenario:

class A  with "bean-a" in wireup.xml  

class B extends A  with "bean-b" in wireup.xml  

Since B is also A, which means there are more than one instance of class A in application context.

I want to uniquely identify the singleton instance of class B, so I used

@Qualifier("unique_name") in class B 

and

<qualifier value="unique_name"/>  in "bean-b" of wireup.xml   

But the issue is still there, I get message as :

No unique bean of type [A] is defined: expected single matching bean but found 2: [A, B]  

How do I resolve this?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:48:14+00:00Added an answer on May 23, 2026 at 1:48 pm

    The @Qualifier should not be put in classB. Instead it should be put along with autowired.
    Your class should look like,

    Class MyClass {
    
      @AutoWired
      @Qualifier("unique_name")
      private B b;
    
      //...
    
    }
    

    By this means you are telling autowire the b with of type B (type B or A because B is subclass of A) but with a bean definition which has the qualifier “unique_name”. The wireup.xml has the qualifier tag assigned to bean-b. Your wireup.xml might look like this

    <bean id="bean-A" class="com.domain.A" />
    <bean id="bean-B" class="com.domain.B"
      <qualifier="unique_name" />
    </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have the following scenario. I have a few form, which essentially have a few
I was curious as to whether the following scenario is safe. I have the
I'd appreciate any advice on which way to go on in the following scenario.
I'm using Django-nonrel on Google App Engine and have the following models (they are
I have a scenario where the models look like create_table :users do |t| t.string
I have a question regarding the MVVM design for C#/WPF. I've had a look
This question is a continuation of this one but asking for a more specific
Scenario: Using jquery form plugin . The form appears in a dialog, created with
I'm trying to write some test cases for my Qooxdoo application, and I think
another day, another problem. Honestly, it would be rather boring if this ever stopped,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.