• Andy Wilkinson's avatar
    Work around brittle annotation scanning in Mojarra · c4122b8f
    Andy Wilkinson authored
    FacesListener in Mojarra 2.2.12 (used in Glassfish 4.1.1) is a
    ServletContainerInitializer that’s annotated to handle types annotated
    with javax.annotation.Resource.
    OAuth2RestOperationsConfiguration.SessionScopedConfiguration is one such
    class. This leads to com.sun.faces.config.DelegatingAnnotationProvider
    calling getAnnotations on SessionScopedConfiguration.class. This fails
    with a java.lang.ArrayStoreException due to SessionScopedConfiguration
    being annotated with @ConditionalOnBean(OAuth2ClientConfiguration) and
    OAuth2ClientConfiguration not being on the classpath.
    DelegatingAnnotationProvider currently catches NoClassDefFoundErrors
    thrown during its annotation processing. It needs to be made more
    robust so that it also copes with an ArrayStoreException, in a similar
    way to how org.glassfish.apf.impl.AnnotationProcessorImpl was updated to
    fix GLASSFISH-21265 [1]. I’ve opened an issue to this effect [2].
    
    In the meantime, we can work around the brittleness in
    DelegatingAnnotationProvider by restructuring
    SessionScopedConfiguration. This commit moves the use of @Resource into
    a nested inner class, ClientContextConfiguration, while leaving the use
    of @ConditionalOnBean on SessionScopedConfiguration. This means that it
    is now ClientContextConfiguration that is passed to FacesListener and
    processed by DelegatingAnnotationProcessor, thereby avoiding exposing
    it to the @ConditionalOnBean annotation that it does not handle
    gracefully. A Glassfish-based deployment test has also been added to
    verify the fix.
    
    Closes gh-2079
    Closes gh-4321
    
    [1] https://java.net/jira/browse/GLASSFISH-21265
    [2] https://java.net/jira/browse/JAVASERVERFACES-4076
    c4122b8f
Name
Last commit
Last update
..
spring-boot-sample-activemq Loading commit data...
spring-boot-sample-actuator Loading commit data...
spring-boot-sample-actuator-log4j Loading commit data...
spring-boot-sample-actuator-log4j2 Loading commit data...
spring-boot-sample-actuator-noweb Loading commit data...
spring-boot-sample-actuator-ui Loading commit data...
spring-boot-sample-amqp Loading commit data...
spring-boot-sample-ant Loading commit data...
spring-boot-sample-aop Loading commit data...
spring-boot-sample-atmosphere Loading commit data...
spring-boot-sample-batch Loading commit data...
spring-boot-sample-cache Loading commit data...
spring-boot-sample-data-cassandra Loading commit data...
spring-boot-sample-data-elasticsearch Loading commit data...
spring-boot-sample-data-gemfire Loading commit data...
spring-boot-sample-data-jpa Loading commit data...
spring-boot-sample-data-mongodb Loading commit data...
spring-boot-sample-data-redis Loading commit data...
spring-boot-sample-data-rest Loading commit data...
spring-boot-sample-data-solr Loading commit data...
spring-boot-sample-devtools Loading commit data...
spring-boot-sample-flyway Loading commit data...
spring-boot-sample-hateoas Loading commit data...
spring-boot-sample-hornetq Loading commit data...
spring-boot-sample-hypermedia Loading commit data...
spring-boot-sample-hypermedia-gson Loading commit data...
spring-boot-sample-hypermedia-jpa Loading commit data...
spring-boot-sample-hypermedia-ui Loading commit data...
spring-boot-sample-integration Loading commit data...
spring-boot-sample-jersey Loading commit data...
spring-boot-sample-jersey1 Loading commit data...
spring-boot-sample-jetty Loading commit data...
spring-boot-sample-jetty-ssl Loading commit data...
spring-boot-sample-jetty8 Loading commit data...
spring-boot-sample-jetty8-ssl Loading commit data...
spring-boot-sample-jetty93 Loading commit data...
spring-boot-sample-jooq Loading commit data...
spring-boot-sample-jpa Loading commit data...
spring-boot-sample-jta-atomikos Loading commit data...
spring-boot-sample-jta-bitronix Loading commit data...
spring-boot-sample-jta-jndi Loading commit data...
spring-boot-sample-liquibase Loading commit data...
spring-boot-sample-logback Loading commit data...
spring-boot-sample-metrics-dropwizard Loading commit data...
spring-boot-sample-metrics-opentsdb Loading commit data...
spring-boot-sample-metrics-redis Loading commit data...
spring-boot-sample-parent-context Loading commit data...
spring-boot-sample-profile Loading commit data...
spring-boot-sample-property-validation Loading commit data...
spring-boot-sample-secure Loading commit data...
spring-boot-sample-secure-oauth2 Loading commit data...
spring-boot-sample-secure-sso Loading commit data...
spring-boot-sample-servlet Loading commit data...
spring-boot-sample-session-redis Loading commit data...
spring-boot-sample-simple Loading commit data...
spring-boot-sample-testng Loading commit data...
spring-boot-sample-tomcat Loading commit data...
spring-boot-sample-tomcat-jsp Loading commit data...
spring-boot-sample-tomcat-multi-connectors Loading commit data...
spring-boot-sample-tomcat-ssl Loading commit data...
spring-boot-sample-tomcat7-jsp Loading commit data...
spring-boot-sample-traditional Loading commit data...
spring-boot-sample-undertow Loading commit data...
spring-boot-sample-undertow-ssl Loading commit data...
spring-boot-sample-velocity Loading commit data...
spring-boot-sample-war Loading commit data...
spring-boot-sample-web-freemarker Loading commit data...
spring-boot-sample-web-groovy-templates Loading commit data...
spring-boot-sample-web-jsp Loading commit data...
spring-boot-sample-web-method-security Loading commit data...
spring-boot-sample-web-mustache Loading commit data...
spring-boot-sample-web-secure Loading commit data...
spring-boot-sample-web-secure-custom Loading commit data...
spring-boot-sample-web-secure-github Loading commit data...
spring-boot-sample-web-secure-jdbc Loading commit data...
spring-boot-sample-web-static Loading commit data...
spring-boot-sample-web-ui Loading commit data...
spring-boot-sample-web-velocity Loading commit data...
spring-boot-sample-websocket-jetty Loading commit data...
spring-boot-sample-websocket-tomcat Loading commit data...
spring-boot-sample-websocket-undertow Loading commit data...
spring-boot-sample-ws Loading commit data...
spring-boot-sample-xml Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...