5 Replies Latest reply on Jun 3, 2015 11:42 AM by benjamin fuentes

    How to use common libraries used by different modules in Wildfly?

    giofyxle Newbie

      Hallo!

       

      We have an EAR and a resource adapter that use the some same libraries. When we install them to Wildfly we give these libraries to each of them.

      And when we try to access the resource adapter from the EAR we experience a Class-Cast-Exception like:

       

      HttpEisFactory cannot be casted into HttpEisFactory. (where HttpEisFactory is a class of one of these libraries used by EAR and resource adapter)

       

      We guess this is because resource adapter and EAR are two separated independent modules inside Wildfly and therefore use separated Class-Loaders.

       

      Therefore we would like to define some "common libraries" that are deployed only once in Wildfly but can be used by different modules. If we moved our libs to this common libraries, we would expect not to see this Class-Cast-Exception.

       

       

      How do I define such "common libraries" in Wildfly?

       

       

      Thanks

       

      Gio