Jboss7 classloading
nimmi Sep 19, 2012 11:49 AMHello All,
I know there are many links on the forum discussing the same but I just wanted some imput from the Jboss community.
We have all the jars required by our application in a separate directory say - C:\Program Files (x86)/application/server/lib
and the config files in C:\Program Files (x86)/application/server/conf. We used to add C:\Program Files (x86)/application/server/lib and C:\Program Files (x86)/application/server/conf to the server classpath and this used to work on JBOSS-5.We deploy our application on multiple platforms(Websphere,Tomcat,Jboss5 etc) and keeping the application jars and config files seperate from the server files has worked well so far.
Now we are upgrading to JBOSS 7 and I cannot add the above folders to jboss classpath.I need to now move all the required jars into seperate modules under JBOSS_HOME\modules and then
in jboss-deployment-structure.xml define the dependencies for Jboss7.This will mean having the jars and config files in 2 separate places.
I found this link - https://community.jboss.org/message/730142 which is about adding another directory to the JBOSS_MODULEPATH.
I did the same.Created an environment variable JBOSS_MODULEPATH=C:\jboss-as-7.1.1.Final\modules:C:\Program Files (x86)\application\server\lib
But on starting Jboss get the below error -
JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xrs -Xms256M -Xmx1024M -XX:MaxPermSize=256M
===============================================================================
org.jboss.modules.ModuleNotFoundException: Module org.jboss.as.standalone:main is not found in local module loader @10f11b8 (roots: C:\jboss-as-7.1.1.Final\modules:C:\Program Files (x86)\application\server\lib)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:204)
at org.jboss.modules.Main.main(Main.java:262)
I even tried creating a module for my config files as - modules\com\application\configuration\main and in the module.xml
<module xmlns="urn:jboss:module:1.1" name="com.mycompany.settings">
<resources>
<resource-root path="C:\Program Files (x86)/application/server/conf"/> --> gave an absolute path.
</resources>
</module>
I did not add my config files to the folder but I expected them to be picked from the location provided but that does not work.
Is there no way of adding an external folder to Jboss 7 classpath ? Any help would be much appreciated.
Thank you.