Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use application lib instead of app server lib

I will create an enterprise project in eclipse and use Wildfly application server. In my project i have some library that may be exists in Wildfy lib folder.
How can i say to application server, if you need any library that exist in your lib and my project lib, please use that library that is exist in my project. For example Wildfly contains JSF implementation and i will use Primefaces. I add Primefaces libraries to my project class path, and i will Wildfly use it, but Wildfly use its own instance.
Thanks.

like image 374
Rasoul Taheri Avatar asked Nov 15 '25 22:11

Rasoul Taheri


2 Answers

Unfortunately it isn't that easy. JBoss has introduced the concept of modules. You'll need to understand how they work if you want to override library versions that JBoss provides. Check out the documentation here:

https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

and

https://docs.jboss.org/author/display/WFLY8/Implicit+module+dependencies+for+deployments

like image 97
jgitter Avatar answered Nov 17 '25 21:11

jgitter


If you add a library to your lib directory WildFly will include those libraries in you class path. Which means if you include Primefaces you will get Primefaces in your class path. WildFly does not include Primefaces as a module.

For server dependencies, like the JSF implementation, WildFly will load it's provided dependency first before the one in your lib directory. That said you don't really want to be overriding implementations like this. It's part of the Java EE specification and will be provided by any Java EE compliant server.

You should also read the links that jgitter suggested.

like image 25
James R. Perkins Avatar answered Nov 17 '25 20:11

James R. Perkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!