You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2013/11/28 03:43:35 UTC

[jira] [Created] (MYFACES-3830) Component created using @FacesComponent with createTag=true and @ResourceDependency makes initialization fail

Leonardo Uribe created MYFACES-3830:
---------------------------------------

             Summary: Component created using @FacesComponent with createTag=true and @ResourceDependency makes initialization fail
                 Key: MYFACES-3830
                 URL: https://issues.apache.org/jira/browse/MYFACES-3830
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-344
    Affects Versions: 2.2.0-beta
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


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.



--
This message was sent by Atlassian JIRA
(v6.1#6144)