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 7459085

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:58:15+00:00 2026-05-29T13:58:15+00:00

Here’s the scenario: I have a standard applicationConfig.xml spring configuration for a basic web

  • 0

Here’s the scenario:

I have a standard applicationConfig.xml spring configuration for a basic web app. It works great. I also have a “core jar” for one of our internal dependencies for a different app. The “core jar” has an AnnotationConfigApplicationContext which registers the different @Configuration beans appropriately. I’m trying to use the annotation @Configuration beans in the app which is configured using the applicationConfig.xml.

I can dream up two options which I believe will work:

  1. Refactor the xml config to also use the annotationConfig and register the different configurations to the context the same way our “core jars” do.

  2. Create a second context and access it directly instead of having the singletons/prototypes live on the same applicationContext as the xml config. I’d really rather not do this as it seems more like a hack than an elegant solution (and I’m not entirely sure it would behave as I’d want it to.)

  3. What I’m dreaming of, but can’t find any documentation to support

I’d like to register the annotation configuration bean into the application context somehow, but I can’t get the objects to line up the way I’d like them to (aka, my context won’t .register() the @Configuration file – only 1 bean at a time….)

Just to follow up – I got this working (YAY). In my case, I ended up following the general pattern set forth by gpeche.

The applicationContext-parent.xml contained the 1 bean def:

<bean id="parentApplicationContext" class="org.springframework.context.annotation.AnnotationConfigApplicationContext" scope="singleton">
    <constructor-arg>
      <list>
        <value>com.package.CoreCommonInContainerConfigImpl</value>
        <value>com.package.CoreCommonCommonConfigImpl</value>
      </list>
    </constructor-arg>
</bean>

where the CoreCommon****Impl classes are @Configuration annotated classes which define beans for that context.

As gpeche noted, an @Autowired Bean bean; inside of a controller (for example) falls back on the parent context and resolves automagically.

THANKS!

  • 0 0 Answers
  • 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

Sidebar

Related Questions

Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario: I'm writing an app that will watch for any changes
Here's the basic setup: I have a thin bar at the top of a
Here's the scenario: I have a local git repository that mirrors the contents of
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here we go again, the old argument still arises... Would we better have a
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here is my problem : I have a post controller with the action create.

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.