title: specifying a file in a classpathresource
body: <p>I am using <code>classpathresource</code> to get the resource of a file . In my code am specifying the path so that the file is picked from there . But its taking a file with same name which is already there in a jar from previous.</p>
  
  <p>i.e.,
  I have specified, </p>
  
  <pre><code>ClassPathResource resource = new ClassPathResource("/sw/merlot/config/log4j.xml")
  </code></pre>
  
  <p>where <code>log4j.xml</code> is the configuration file.</p>
  
  <p>But its taking a <code>log4j.xml</code> which is in a jar -- <code>sw/merlot/lib/keyManager.jar!/log4j.xml</code></p>
  
  <p>(Both <code>log4j.xml</code> are different [2 different configuration files])</p>
  
  <p>So i changed it to,</p>
  
  <pre><code>ClassPathResource resource = new ClassPathResource("file:///sw/merlot/config/log4j.xml")
  </code></pre>
  
  <p>But its still not working .</p>
  
  <p>I dont know if the way I have specified the file is correct or not?</p>
  
  <p>I also tried to specify the file using a jar .</p>
  
  <pre><code>ClassPathResource resource = new ClassPathResource("jar:file:///sw/merlot/lib/keyManager111.jar!/log4j.xml")
  </code></pre>
  
  <p>where <code>keyManager111.jar</code> contains my <code>log4j.xml</code> which i want. But its still not picking from the jar. Its telling file not found at the specified location.</p>