-
1. Re: Classloader Problem [AS 7.1.1.Final]: 3rd-party libraries and getResource[AsStream]
jaikiran May 16, 2012 4:50 AM (in response to grubi)InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath);
How is that hapax library integrated in your application? As a module? Or have you placed that hapax jar within your web application's lib folder?
-
2. Re: Classloader Problem [AS 7.1.1.Final]: 3rd-party libraries and getResource[AsStream]
grubi May 16, 2012 5:14 AM (in response to jaikiran)The library is in the war's lib folder.
-
3. Re: Classloader Problem [AS 7.1.1.Final]: 3rd-party libraries and getResource[AsStream]
jaikiran May 16, 2012 5:17 AM (in response to grubi)Can you please some way generate some kind of stacktrace (maybe the same way you figured out it's using the sun.jdk module classloader) which shows the exact call hierarchy. And do you have any jboss-deployment-structure.xml in your application? If yes, what does it look like?
-
4. Re: Classloader Problem [AS 7.1.1.Final]: 3rd-party libraries and getResource[AsStream]
grubi May 16, 2012 6:01 AM (in response to jaikiran)No, I don't have such an xml.
What stacktrace do you exactly need? And how can i get it?
That's how I get the path. It is called from a class from a library in the war's lib folder that uses hapax (in the same lib folder).
System.out.println("Loader: " + getClass().getClassLoader());
System.out.println("Root: " + getClass().getClassLoader().getResource("/"));
That's the output (MT is the name of my war (MT.war))
Loader: ModuleClassLoader for Module "deployment.MT.war:main" from Service Module Loader
Root: file:/D:/JBoss7/jboss-as-7.1.1.Final/modules/sun/jdk/main/service-loader-resources/