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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:06:10+00:00 2026-05-15T17:06:10+00:00

I have three projects – proj-a, proj-b, and main such that main depends on

  • 0

I have three projects – proj-a, proj-b, and main such that main depends on proj-a and proj-b.

proj-a and proj-b each contains a module-context.xml and properties file.

proj-a module-context.xml

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:property-placeholder location="classpath:/META-INF/proj-a.properties"/>
    <bean ... someProperty="${property-a}" />
</bean>

proj-a.properties

property-a=hello-a

proj-b’s configuration is identical except a is replaced by b.

proj-b module-context.xml

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:property-placeholder location="classpath:/META-INF/proj-b.properties"/>
    <bean ... someProperty="${property-b}" />
</bean>

proj-b.properties

property-b=hello-b

A Class in main wants to create an ApplicationContext that consists of both proj-a and proj-b’s module-context.xml. The problem is that only one of the properties file is processed by spring. If proj-a’s module-context.xml’s loaded first, proj-b’s properties file is never read.

The following snippet throws an Exception.

public static void main( String[] args ) throws IOException {

    ApplicationContext context = new FileSystemXmlApplicationContext( new String[] { 
            "../proj-a/src/main/resources/META-INF/spring/module-context.xml",
            "../proj-b/src/main/resources/META-INF/spring/module-context.xml"
    } );
}

throws

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name '...' defined in file [...\proj-b\src\main\resources\META-INF\spring\module-context.xml]: Could not resolve placeholder 'property-b'
at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:272)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:599)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)

How can I properly load the properties files? Merging them is not a solution because properties are project specific.

  • 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-15T17:06:12+00:00Added an answer on May 15, 2026 at 5:06 pm

    I found a solution – set property ignoreUnresolvablePlaceholders to true.

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

Sidebar

Related Questions

I have a Pocket PC 2003 solution, consisting of three projects, that was created
I currently have three independent projects on my plate - each requiring development in
I'm working in VS 2008 and have three projects in one solution. I'm debugging
I have 3 projects in my solution that I want to deploy. Is there
I have 3 projects in my solution that I want to deploy. Is there
I have three projects written with VB.NET (2005) and have to convert them to
Suppose I have three projects in my sln. (1) xyz.a{Class Lib}{no reference added} (2)
I am creating solution and inside I have three projects: A WCF Service Library
Strange and probably trivial problem. I have three projects in one solution (.NET 2.0,
In a visual studio project I have three layers, Data Layer, Business Layer and

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.