- We are converting from weblogic to JBoss. We have some typical code that loads an xml file using
InputStream is = getClass().getResourceAsStream(FILENAME);
This works fine in one class. In another class we use
InputStream is = Class.class.getResourceAsStream(FILENAME);
Because that class is a singleton and is set up with static methods so getClass() won't work. We also tried Classloader.getResourceAsStream(FILENAME) but that didn't work either. When then switched the class to be non-static and it works too. Is there a way to get the classloaders to work properly with a static method?
- JBoss Enterprise Application Platform (EAP)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.