Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24035

Allow deployments with 'unused' beans annotated with Jakarta Faces @ManagedProperty to deploy

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Obsolete
    • Major
    • None
    • None
    • JSF
    • None
    • False
    • None
    • False

    Description

      If a deployment includes 'cruft' CDI beans that have fields annotated with jakarta.faces.annotation.ManagedProperty, allow the deployment to deploy even if if does not include any of the items[1] that trigger installation of the FacesServlet. The absence of the FacesServlet means the beans won't be accessible via HTTP requests, hence they are 'cruft'. But such cruft doesn't mean the deployment should fail.

      As of the date I'm creating this JIRA the WIP Jakarta EE 10 Platform TCK includes such deployments, leading to the problem described in WFLY-16433.  CDI sees the 'cruft' bean and the Inject annotation on a field. It tries to process the bean but fails due to not finding any bean to inject that has the ManagedProperty qualifier.

      Expected solution is to update JSFVersionProcessor.shouldJsfActivate to return true if the ManagedProperty annotation is found in the deployment. That is sufficient to trigger loading of the com.sun.faces.cdi.CdiExtension which in turn ensures an appropriate bean with the ManagedProperty qualifier is installed. That allows the deployment to deploy.

      Note that the intent here isn't to also trigger installation of the FacesServlet if it wasn't already being installed.

       

       [1]See class javadoc at https://jakarta.ee/specifications/faces/4.0/apidocs/jakarta/faces/webapp/facesservlet

      Attachments

        Issue Links

          Activity

            People

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: