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 7958525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:26:11+00:00 2026-06-04T04:26:11+00:00

I have a big application which i want to break up into manageable modules.

  • 0

I have a big application which i want to break up into manageable modules. I am using spring with Jpa (Hibernate as a provider). I came up with a structure where I have a core module containing all the entity and dao classes, and the other modules make use of the core module regarding persistence, and each one of them will have its own set of service classes and controllers.

enter image description here

All Jpa and spring configuration files are in the core module. With this setup I am facing a problem of autowiring dao beans in the modules making use of the core module. So my question is, is it possible to autowire beans from the core module in the other modules (or probably use a context across modules)? I am also open to suggestions regarding the structure, if there is a better way of doing it.

Thanks

  • 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-04T04:26:12+00:00Added an answer on June 4, 2026 at 4:26 am

    The Core Module must be the parent Spring context that must be setted in each child context module. By this way there’s no ploblem with autowiring

    Every child context can reach all beans from parent, but be aware of that parent can’t see the children

    Depending on how you’ve configured your application, you can do this in several ways, i. e.

    1. Distributing your core module in a separate jar to every module, as it’s described in this article Sharing a spring context across multiple Webapps
    2. Programatically, having your core spring xml in each child module, you can do this:

      ClassPathXmlApplicationContext parentAppContext = new ClassPathXmlApplicationContext();
      parentAppContext.setConfigLocation("spring-core.xml"); // this is your core spring xml
      parentAppContext.refresh();
      ClassPathXmlApplicationContext moduleAppContext = new ClassPathXmlApplicationContext();
      moduleAppContext.setConfigLocation("others.xml");
      moduleAppContext.setParent(parentAppContext);
      moduleAppContext.refresh();
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a big application having 13 modules. We want to create war file
I have an application in which I want to force an image to download,
We have a big winform application which we install on the users disk. We
Many applications have dialogs which have totally custom-looking dialogs, big fat tool-bars and non-rectangular
I have inherited an big existing PHP application (website actually) that runs on Apache.
Suppose that you have a big Data Entry Web Application Like Microsoft CRM ,
I have a big text file (5Mb) that I use in my Android application.
I have a very strange situation. I´m working on a pretty big Java application
I have a php web application that uses big cookies to store a lot
I have big URL list, which I have to download in parallel and check

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.