Sep 6th, 2012, 02:50 AM
Loading Spring context files form jars
In my project I have the following situation: we are several partners and each partner will develop a component. Each partner will have his own database so each partner will define his own datasourse, sqlsessionfactory (we are using mybatis), transactionmanager etc....
Moreover each partner will have his own configuration file (a .properties file) loaded by using the org.springframework.beans.factory.config.PropertyP laceholderConfigurer
Each component will be a JAR in the web-inf/lib directory
Now I saw the following: partner A and partner B developed two simple components. By doing their own tests (partner A for the component A and partner B for component B) all worked pretty good
When I tried to test the two components under the main web-app I noticed that only one properties file has been loaded so one component worked and the other one didn't work.
Is there a way in orther to load all the properties file from different jars? (Note that I don't know the properties file names)
Moreover I told partners to use unique ids for bean definition in order to avoid the bean overriding (for example the datasource bean for partner A should have this id: dataSourceA while the datasource bean for partner B should have this id: dataSourceB and so on....). Is this approach good and valid?
Was anybody in this situation? Do you have any kind of suggestion?
Thank you so much