Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3830

Component created using @FacesComponent with createTag=true and @ResourceDependency makes initialization fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0-beta
    • 2.2.0
    • JSR-344
    • None

    Description

      Doing some tests over MyFaces Core, I found that if there is a declaration like this:

      @ResourceDependency(name="test1.js")
      @FacesComponent(createTag=true,
      namespace="http://myfaces.apache.org/testComponent",
      tagName="simpleComponentA", value="org.apache.myfaces.view.facelets.pool.UISimpleComponentA")
      public class UISimpleComponentA extends UIComponentBase

      It throws NullPointerException in Application.createComponent. The reason is in FaceletsCompilerSupport there are some lines that help us to get the default rendererType to use it later, but when the @ResourceDependency is found, it is added to the current view root, which is just wrong.

      The solution is use a FacesContext wrapper and set a dummy UIViewRoot when this initialization step is done.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: