I am working on a similar problem with my product. A bunch of configuration files are expected to be in the classpath. Currently it seems there is no straight solution. This is a problem.
I am also facing this problem. Found any solution?
1 of 1 people found this helpful
I worked out a solution for this. Still looks a bit hacky but works.
Step 1 :
Create a module out of the conf folder. So I created JBOSS_HOME/modules/com/myorg/myapp/1.0/conf
Copy the original contents of conf (those you wanted in classpath) into this folder.
Created JBOSS_HOME/modules/com/myorg/myapp/1.0/module.xml like below
<module xmlns="urn:jboss:module:1.1" name="com.myorg.myapp" slot="1.0">
<!-- Insert resources here -->
modified my jboss-deployment-structure.xml to add a dependency to my conf module
<module name="org.myorg.myapp" slot="1.0"/>
That is all. The resources were discovered on the classpath. This solution works for us since the 'conf' remains as a folder and is tunable.
Thanks a lot, That worked.
But is there any way possible to specify an external folder ( not in the modules directory ) as the resource-root path ?
I did something similar rather than creating a module I had already deployed an exploded war as the root context of the container.
So I placed the config files in the classes directory of the exploded war I then added the following to jboss-deployment-structure.xml
<module name="deployment.abs.war" />
It would be nice to see if there is a solution to this problem rather then the work arounds we have come up with.
Is there any progress on this issue ?
classpath seems to be tied to the solutions above alternativly add a system property of a dir to search for your local file