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?
The library is in the war's lib folder.
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?
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