title: Spring : PropertyPlaceholderConfigurer cannot find property file
body: <p>I have a strange problem with Spring using <code>PropertyPlaceholderConfigurer</code>. One of my beans is designed as follow :</p>
  
  <pre><code>&lt;bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;property name="locations"&gt;
          &lt;value&gt;classpath:jdbc.properties&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The problem is that spring never find jdbc.properties (<code>FileNotFoundException</code>). The file is in a folder named "resources" that is in the bundle classpath (I am working in a OSGi project).</p>
  
  <p>I have tried almost every combination ("jdbc.properties", "/jdbc.properties", "classpath:jdbc.properties", "classpath:/jdbc.properties", "/resources/jdbc.properties", etc...) but it never works.</p>
  
  <p>For information, if at some point, I do something like : </p>
  
  <pre><code>URL u = someClassLoader.getResource("jdbc.properties");
  </code></pre>
  
  <p>it does work without any problem and find the file. Actually I am totally unable to understand what is the bug with spring.</p>
  
  <p>If you have any idea to help me, thanks in advance. I am not very experienced in spring so I have maybe done a mistake somewhere.</p>
  
  <p>[EDIT]</p>
  
  <p>Actually, it's a problem of classloader :
  If I do :</p>
  
  <pre><code>new ClassPathResource("jdbc.properties");
  </code></pre>
  
  <p>it doesn't work. But :</p>
  
  <pre><code>new ClassPathResource("jdbc.properties",someClassIntheBundle.class.getClassLoader());
  </code></pre>
  
  <p>works perfectly.</p>
  
  <p>I do believe that Spring use the ClassLoader of its own bundle that is consumed by my bundle. Do you know a way to solve this tricky problem ?</p>
  
  <p>Thanks,</p>