-
1. Re: adding local file to classpath
bonigv Mar 5, 2012 12:35 AM (in response to crazycradd)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.
-
2. Re: adding local file to classpath
sony2006 Mar 5, 2012 1:34 AM (in response to bonigv)Hi
I am also facing this problem. Found any solution?
Thanks
Sony
-
3. Re: adding local file to classpath
bonigv Mar 5, 2012 4:11 AM (in response to bonigv)1 of 1 people found this helpfulI 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
Step 2:
Copy the original contents of conf (those you wanted in classpath) into this folder.
Step 3:
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">
<resources>
<resource-root path="conf"/>
<!-- Insert resources here -->
</resources>
</module>
Step 4:
modified my jboss-deployment-structure.xml to add a dependency to my conf module
<dependencies>
<module name="org.myorg.myapp" slot="1.0"/>
</dependencies>
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.
-
4. Re: adding local file to classpath
sony2006 Mar 5, 2012 3:56 AM (in response to bonigv)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 ?
Thanks
Sony
-
5. Re: adding local file to classpath
crazycradd Mar 5, 2012 4:36 AM (in response to bonigv)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
<dependencies>
<module name="deployment.abs.war" />
</dependencies>
It would be nice to see if there is a solution to this problem rather then the work arounds we have come up with.
-
6. Re: adding local file to classpath
snicktc Oct 10, 2012 7:03 AM (in response to crazycradd)Is there any progress on this issue ?
-
7. Re: adding local file to classpath
crazycradd Oct 10, 2012 7:22 AM (in response to snicktc)classpath seems to be tied to the solutions above alternativly add a system property of a dir to search for your local file