title: How to refer to a file present within src/main/resources folder deployed in a jboss env?
body: <p>I need to look up for an image present in <code>src/main/resources</code> folder in a web application. Its an <code>Apache CXF SAOP</code> based web application.</p>
  
  <p>We are running it in a <code>jboss env(jboss-eap-6.4)</code></p>
  
  <p>After building the war, the same is deployed.</p>
  
  <p>However, I am unable to get the correct path to the above file.
  Please suggest.</p>
  
  <p>I have tried multiple options.</p>
  
  <pre><code>File logo= new File("src/main/resources/image.jpg");    
  logo.getAbsolutePath(); //  This works great when Junit tested, however breaks with the server. 
  </code></pre>
  
  <p>Neither does this works- </p>
  
  <pre><code>ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
  contextClassLoader.getResource("image.jpg").getPath();
  </code></pre>