[
https://issues.apache.org/jira/browse/MYFACES-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonardo Uribe reopened MYFACES-2225:
-------------------------------------
We have an exception when <h:outputScript target="head"> is used. This is
present because when PostAddToViewEvent is broadcast, we don't take into
account that this event trigger component relocation for h:outputScript,
h:outputStylesheet, composite:insertChildren, composite:insertFacet. So we need
to check if the component was moved after PostAddToViewEvent is published.
I tried several solutions (write an iterator/listIterator for
_ComponentChildrenList that deal in some way with it, taking the source code
from apache harmony, put components in a neutral space and then move all) and
the most reasonable (read it as "more friendly with the spec and with us!") is
change UIComponentBase._publishPostAddToViewEvent(FacesContext, UIComponent) to
take into account this fact.
> Implement PostAddToViewEvent and PreRemoveFromViewEvent thrown conditions
> -------------------------------------------------------------------------
>
> Key: MYFACES-2225
> URL: https://issues.apache.org/jira/browse/MYFACES-2225
> Project: MyFaces Core
> Issue Type: Task
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Leonardo Uribe
> Fix For: 2.0.0-alpha
>
>
> The following stack overflow is thrown when the component tree is manipulated
> (resource + annotation + event api).
> It seems on the last javadoc, new methods where added:
> UIComponent.isInView (maybe another synonym to this method is
> isInComponentTree)
> UIComponent.setInView(boolean isInView)
> and new description added:
> UIComponent.setParent(UIComponent parent)
> so the solution proposed by the change in UIComponent.getChildren is
> insuficient.
> javax.servlet.ServletException: java.lang.StackOverflowError
> at
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:939)
> at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:871)
> at
> org.apache.jsp.helloWorld1_jsp._jspService(org.apache.jsp.helloWorld1_jsp:106)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
> at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:334)
> at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
> at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:434)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.buildView(JspViewHandlerImpl.java:492)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:343)
> at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:45)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:167)
> at
> javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:428)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
> Caused by: java.lang.StackOverflowError
> at java.lang.reflect.Constructor.copy(Constructor.java:133)
> at
> java.lang.reflect.ReflectAccess.copyConstructor(ReflectAccess.java:126)
> at
> sun.reflect.ReflectionFactory.copyConstructor(ReflectionFactory.java:296)
> at java.lang.Class.copyConstructors(Class.java:2757)
> at java.lang.Class.getConstructors(Class.java:1459)
> at
> org.apache.myfaces.application.ApplicationImpl._createEvent(ApplicationImpl.java:1484)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1701)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
> at
> org.apache.myfaces.renderkit.html.HtmlStylesheetRenderer.processEvent(HtmlStylesheetRenderer.java:65)
> at
> javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:919)
> at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> at
> org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:1709)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:459)
> at
> org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:481)
> at
> javax.faces.component._ComponentChildrenList.childAdded(_ComponentChildrenList.java:133)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:82)
> at
> javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:1)
> at
> javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:161)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.