-
1. Re: how to load spring libs as modules in wildfly ?
abhinav.gupta01 May 7, 2015 3:34 AM (in response to samalaraj72)1 of 1 people found this helpfulHi,
Below is example from my custom module I create to keep oracle driver jar :
I created on directory under wildfly modules as system\layers\base\com\oracle\ojdbc14\main
Now put all your jars in this directory. Add one module.xml file in same directory with entries of your jar files :
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc14">
<resources>
<resource-root path="ojdbc14.jar"/>
<resource-root path="second jar"/>
<resource-root path="third jar "/>
..
..
..
</resources>
<dependencies>
</dependencies>
</module>
pay attention , I keep my directory structure consistent to my Name property in module. You can add as many jars as you need to this directory and add entry for resource-root path
Now to use this module , you can add entry in jboss-deployment-structure.xml in your applications META-INF , like :
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
..
..
..
<module name = "com.oracle.ojdbc14"/>
</dependencies>
..
..
..
</jboss-deployment-structure>
Hope this helps
-Abhinav
-
2. Re: how to load spring libs as modules in wildfly ?
samalaraj72 May 11, 2015 4:19 AM (in response to samalaraj72)Hi Abhinav,
Thanks for reply,
i've added the jar's as module and configured module name in jboss-deployment-structure.xml file too.
here am attaching screenshot. my jar name is ojdbc14.jar
but am not loading jar in build path of server.
can you guide me,how to get my jar in build path, do we need any special configuration in wildfly apart above solution ?
-
3. Re: how to load spring libs as modules in wildfly ?
abhinav.gupta01 May 11, 2015 5:58 AM (in response to samalaraj72)Can you explain issue a bit more ?
" my jar name is ojdbc14.jar" >> I think you mistype here. ? Please confirm.
You getting exceptions while running your application ? If yes please post trace.
If you mean you dont see that jar , in eclipse classpath , that Ok.. module we created will be available in classpath at runtime.
-
4. Re: how to load spring libs as modules in wildfly ?
samalaraj72 May 11, 2015 6:04 AM (in response to abhinav.gupta01)hi,
am not getting any exceptions,
i've configured everything, but am unable to use the classes in lib as that lib is not listed in java build path.
-
5. Re: how to load spring libs as modules in wildfly ?
abhinav.gupta01 May 13, 2015 1:19 AM (in response to samalaraj72)2 of 2 people found this helpfulIf you need them for compile time dependency , then you need to add them manually , as far as I think.
Because adding modules to wildfly just resolve runtime denpendencies
-
6. Re: how to load spring libs as modules in wildfly ?
samalaraj72 May 13, 2015 8:30 AM (in response to abhinav.gupta01)Hi Abhinav, Thanks for the help,it's working now.
-
7. Re: how to load spring libs as modules in wildfly ?
hemanthkolla Apr 4, 2017 3:48 PM (in response to abhinav.gupta01)Abhinav,
Do you think adding all the jar files to one Module will help in resolving internal dependencies? I have 50 some jar files which are needed at run time and they have some internal dependencies.
Thanks,
Hemanth K