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

StackOverflowError when adding componentResource with id=null

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1-SNAPSHOT
    • 2.0.1
    • JSR-314
    • None
    • myfaces trunk, tomcat 6.0.26

    Description

      If second parameter - the componentResource:

      UIViewRoot.addComponentResource(FacesContext context, UIComponent componentResource)

      has null id then StackOverflowError occurs:

      Caused by: java.lang.StackOverflowError
      at java.lang.ThreadLocal.get(ThreadLocal.java:124)
      at javax.faces.context.FacesContext.getCurrentInstance(FacesContext.java:71)
      at javax.faces.component.UIComponentBase.getFacesContext(UIComponentBase.java:1057)
      at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:174)
      at javax.faces.component._ComponentChildrenList.childRemoved(_ComponentChildrenList.java:123)
      at javax.faces.component._ComponentChildrenList.remove(_ComponentChildrenList.java:147)
      at javax.faces.component._ComponentChildrenList.removeChildrenFromParent(_ComponentChildrenList.java:136)
      at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:76)
      at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:30)
      at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:188)
      at org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:86)
      at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1098)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
      at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1955)
      at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:504)
      at javax.faces.component.UIComponentBase._publishPostAddToViewEvent(UIComponentBase.java:201)
      at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:186)
      at javax.faces.component._ComponentChildrenList.updateParent(_ComponentChildrenList.java:128)
      at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:79)
      at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:30)
      at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:188)
      at org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:86)
      at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1098)
      ....

      This probably does not happen if componentResource is created from a facelet but only if it created from java code (a listener in my case)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lu4242 Leonardo Uribe
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment