[JAVASERVERFACES-1111] Use getResources("META-INF/facesconfig.xml") to find classpaths to scan for annotations Created: 08/May/09 Updated: 26/Jun/12 Resolved: 04/Sep/09 Status: Project: Component/s: Affects Version/s: Fix Version/s: Closed javaserverfaces None 2.0.0 PR Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Environment: Bug mojavelinux Fixed None Not Specified Issuezilla Id: 1,111 2.0.0-b18 Priority: Assignee: Votes: Major Ryan Lubke 0 Not Specified Not Specified Operating System: All Platform: All Description Mojarra explicitly scans JAR files that are located in WEB-INF/lib to find JSF 2 annotations. This prevents developers from deploying annotated classes in the EJB-JAR or EAR lib directory. It also prevents embedded containers that load JARs from alternate places in the file system from finding annotated classes (such as Jetty using the local Maven repository). Rather than retrieve the WEB-INF/lib resource path, annotated classes should be scanned by loading all resources with META-INF/faces-config.xml and scanning from there. This is consistent with how Seam and other annotated-based frameworks scan. Comments Comment by mojavelinux [ 08/May/09 ] Examples: http://anonsvn.jboss.org/repos/webbeans/extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environm http://anonsvn.jboss.org/repos/seam/branches/community/Seam_2_1/src/main/org/jboss/seam/deployment/Stand Comment by Ryan Lubke [ 11/May/09 ] Update target milestone Comment by Ryan Lubke [ 16/Jun/09 ] Assigned Comment by Ryan Lubke [ 30/Jun/09 ] After reviewing section 11.5.1 of the spec, the only requirements are to ensure that classes in WEB-INF/classes and JARs that meet specific criteria in WEB-INF/lib are scanned, it doesn't now however restrict other locations from being scanned. Given this, it seems that we can make this change. Comment by driscoll [ 09/Jul/09 ] Move to new milestone Comment by Ryan Lubke [ 14/Aug/09 ] Review for FCS. Comment by Ryan Lubke [ 02/Sep/09 ] We've introduced an SPI called com.sun.faces.spi.AnnotationProvider. So container providers, such as JBoss, can provide optimized annotation scanning as well as scan locations outside of the locations defined by the specification. Comment by Ryan Lubke [ 03/Sep/09 ] Re-opening as I have a solution that doesn't require implementing the SPI. Comment by Ryan Lubke [ 04/Sep/09 ] Changes applied (r7820) to support this feature without having to implement a custom SPI (tested that it works on JBoss 5.1.0). Comment by Manfred Riem [ 13/Mar/12 ] Closing issue out Generated at Wed Feb 10 05:26:07 UTC 2016 using JIRA 6.2.3#6260sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.