I was going through JBoss.org how to put external file in the classpath, but it doesn't work.
I have 1 file with name "config.properties". It is placed in jboss/modules/com/xsiraul/test/main/ folder. In the same folder there is module.xml which looks like -
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.xsiraul.test">
<resources>
<resource-root path="."/>
</resources>
</module>
I have load config.properties
file from Java using -
InputStream settingsStream = getClass().getClassLoader().getResourceAsStream("config.properties");
Java class is in package named com.xsiraul.test
The problem is that method getResourceAsStream
returns NULL and I don't understand why. Maybe somebody has any ideas?
I use JBoss
EAP
6.1.0.GA version.