Custom tag libraries not supported together with libraries external bundles


I have a web application bundle using JSF which I run via pax web in karaf.
There I tried using a custom JSF tag library, defined via context parameter javax.faces.FACELETS_LIBRARIES in my web.xml:

I am also using PrimeFaces in my bundle which provides its own two tag libraries.


When running my application either my own tag library is found or the ones from PrimeFaces (this is random) but never all of them.
Occurred with pax web version 4.2.8.

Likely cause:

I tracked down the bug to class org.ops4j.pax.web.extender.war.internal.parser.WebAppParser: Incidentally there is a TODO which relates to my problem: // TODO merge with any user-defined values.
When defining a custom tag library and including tag libraries from other bundles, multiple entries for FACELETS_LIBRARIES are added to the list of context parameters. Later these are added to a HashMap where the values overwrite each other (same key), which explains the random behavior I see.
As this code is still present in version 6.0.6 I assume it would fail there too (not tested though).
The respective code was added in issue PAXWEB-614.


Move your custom tag library to its own bundle. Including mutliple tag libraries from multiple bundles works fine, as long as no FACELETS_LIBRARIES are defined in the web.xml.
Unfortunately the cause is hard to track down for a new user (especially because of the random behavior).




Grzegorz Grzybek


Benjamin Wiesmüller



Fix versions

Affects versions