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

  • SEARCH
  • Home
  • 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 8064955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:30:58+00:00 2026-06-05T11:30:58+00:00

Is having two definition for a bean (with same name and class) valid in

  • 0

Is having two definition for a bean (with same name and class) valid in Spring IOC ?

I am having two bean definition files included in web.xml. See the sample below.

applicationContext-beans1.xml

<bean name="myWao"
    class="com.beans.myBean">       
</bean> 

applicationContext-beans2.xml

<bean name="myWao"
    class="com.beans.myBean">       
</bean> 

I am not facing any issue till now. But, will this possibly impact in the real environment which will be multi threaded and clustered ?

Note: Both the XMLs are loaded as I am able to use the other beans defined(only once) in both the XMLs

  • 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-06-05T11:31:01+00:00Added an answer on June 5, 2026 at 11:31 am

    It’s valid, but you’ll find that one bean is overridden by the other. You’ll see this in the logs as

    Overriding bean definition for...
    

    This behaviour allows you to override previously supplied bean definitions. It affects the static assembly of your app, and doesn’t relate to threading/clustering as suggested in your question.

    Note that the DefaultListableBeanFactory allows you to configure this behaviour via setAllowBeanDefinitionOverriding()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two CSS files in my web app: reset.css and screen.css. They appear
Having two forms, each in it's own jQuery UI tab, how can I post
I having two arrays say, $array1 = array(code => E0089, desc => some description);
We are having two load balancing server. In that we have hosted a asp.net
I am having two activities A and B. when i click the button in
I am having two issues: I usually create separate view for the login to
My layout having two parts. I want to change the upper part by keeping
I am having two tables Room_master and Room_Item Room_Master => roomid - pk, roomname
I'm having two jquery's that I run and I want to combine them both
hello friends i am having two frames, each frame has a html form which

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.