Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13520

mediaOutput: NPE is thrown when used with CDI beans and JSF 2.2

    Details

      Description

      When mediaOutput is bound via value attribute to a CDI bean, following NPE is thrown:

      15:32:20,443 ERROR [io.undertow.request] (default task-16) UT005023: Exception handling request to /metamer/faces/rfRes/org.richfaces.ui.output.mediaOutput.MediaOutputResource: java.lang.NullPointerException
      	at org.richfaces.ui.output.mediaOutput.MediaOutputResource.encode(MediaOutputResource.java:66) [richfaces-5.0.0-SNAPSHOT.jar:5.0.0-SNAPSHOT]
      	at org.richfaces.resource.UserResourceWrapperImpl.encode(UserResourceWrapperImpl.java:187) [richfaces-5.0.0-SNAPSHOT.jar:5.0.0-SNAPSHOT]
      	at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:229) [richfaces-5.0.0-SNAPSHOT.jar:5.0.0-SNAPSHOT]
      	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:643) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:93) [classes:]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:70)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:69) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:101) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:685) [undertow-core-1.0.0.Beta33.jar:1.0.0.Beta33]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
      	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
      

      Note that everything works with JSF 2.1.x (AS 7.1.1.Final) and when Managed Beans are used.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bleathem Brian Leathem
                Reporter:
                jhuska Juraj Húska
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: