title: ActiveMQ not able to read the .jks file within a jar while creating connection
body: <p>I'm trying to create an <code>ActiveMQSslConnection</code>. I have the truststore file (.jks) as part of a distributed jar. However, ActiveMQ is not able to read the file and throws <code>FileNotFoundException</code>. I verified the jar file and I do see the corresponding file, as in below structure.</p>
  
  <p><code>sample.jar</code>:</p>
  
  <ul>
  <li>META-INF </li>
  <li>com.sample.jms   -- Package</li>
  <li>sample.jks       -- File trying to load</li>
  <li>sample.properties</li>
  </ul>
  
  <p>I ran the program in debug mode and see that ActiveMQ not able to find the file in jar. I changed the file path to outside jar and can read the file. 
  To be precise it is at this below location in <code>org.apache.activemq.ActiveMQSslConnectionFactory</code>.</p>
  
  <pre class="lang-java prettyprint-override"><code>protected InputStream getInputStream(String urlOrResource) throws IOException {
      try {
          File ifile = new File(urlOrResource);
          // only open the file if and only if it exists
          if (ifile.exists()) {  // **This condition failed**
              return new FileInputStream(ifile);
          }
      } catch (Exception e) {
      }
  
      InputStream ins = null;
  
      try {
          URL url = new URL(urlOrResource);
          ins = url.openStream();  //**Throwing exception here. Obviously could not find the file in jar.**
          if (ins != null) {
              return ins;
          }
      } catch (MalformedURLException ignore) {
      }
      ...
  }
  </code></pre>
  
  <p>I wonder why ActiveMQ is not using <code>getClass().getResourceAsStream()</code> instead. I think that should possible work.</p>
  
  <p>How can I fix this issue, by reading the .jks from within a jar?</p>