Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 different <context:property-placeholder: Could not resolve property placeholder

 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Loaded via web:





Exception:



Why exception for : <property name="url" value="${url}"/> from applicationContext-jpa.xml

 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
0. To debug:


1. only loaded classpath:concepts/dao/jpa/accessdb.properties

INFO : org.springframework.context.support.PropertySourcesPlaceholderConfigurer - Loading properties file from class path resource [concepts/dao/jpa/accessdb.properties]


2. why exception because classpath:concepts/dao/jpa/hsqldb.properties
was not loaded. So 'url' could not be resolved.



3. 1 possible solution:


4. The best is yet to come. (propose a better one if have.)
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for you scenario you only need one, there is nothing wrong with loading multiple propery files using one configurer. If you really needed multiples you should use the 'order' property.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic