title: load URL Resources from the Classpath on JBoss AS 7
body: <p><a href="https://stackoverflow.com/questions/861500/url-to-load-resources-from-the-classpath-in-java">URL to load resources from the classpath in Java</a> describes how to use a <code>URLStreamHandler</code> for enabling url-paths like <code>new URL("classpath:org/my/package/resource.extension")</code></p>
  
  <p>I would like to use the same Approach on JBoss AS 7, but calling <code>java.net.URL.setURLStreamHandlerFactory(URL.java:1102)</code> results in  <code>java.lang.Error: factory already defined</code></p>
  
  <p>So AS 7 has its <code>URLStreamHandlerFactory</code> allready set and this can be done only once.</p>
  
  <p>Are there alternative ways to register a <code>URLStreamHandler</code> for the prefix <code>classpath:</code> on jboss or may I even get around with the <code>vfs</code>?     </p>