[ 
https://issues.apache.org/jira/browse/MYFACES-2888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900889#action_12900889
 ] 

Nick Belaevski commented on MYFACES-2888:
-----------------------------------------

Leonardo,

Thanks for looking at the issue! 

To details:

1) ComponentTagHandlerDelegate is implementation-private interface while 
ComponentHandler is not. Also ComponentTagHandlerDelegate doesn't provide 
onComponentPopulated(...) method
2) I'm attaching test project. Stack traces are the following:

a) when check for ComponentHandlerWrapper is commented out
java.lang.StackOverflowError
        at 
java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:142)
        at java.lang.StringBuffer.setLength(StringBuffer.java:153)
        at 
org.apache.myfaces.view.facelets.compiler.TextUnit.flushTextBuffer(TextUnit.java:134)
        at 
org.apache.myfaces.view.facelets.compiler.TextUnit.flushBufferToConfig(TextUnit.java:268)
        at 
org.apache.myfaces.view.facelets.compiler.TextUnit.createFaceletHandler(TextUnit.java:73)
        at 
org.apache.myfaces.view.facelets.compiler.CompilationUnit.getNextFaceletHandler(CompilationUnit.java:84)
        at 
org.apache.myfaces.view.facelets.compiler.TagUnit.getNextHandler(TagUnit.java:61)
        at 
org.apache.myfaces.view.facelets.tag.AbstractTagLibrary$ComponentConfigWrapper.getNextHandler(AbstractTagLibrary.java:431)
        at javax.faces.view.facelets.TagHandler.<init>(TagHandler.java:41)
        at 
javax.faces.view.facelets.MetaTagHandler.<init>(MetaTagHandler.java:37)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.<init>(DelegatingMetaTagHandler.java:41)
        at 
javax.faces.view.facelets.ComponentHandler.<init>(ComponentHandler.java:38)
        at demo.ComponentHandlerWrapper.<init>(ComponentHandlerWrapper.java:17)
        at 
demo.TagHandlerDelegateFactoryImpl.createComponentHandlerDelegate(TagHandlerDelegateFactoryImpl.java:34)
        at 
javax.faces.view.facelets.ComponentHandler.<init>(ComponentHandler.java:45)
        at demo.ComponentHandlerWrapper.<init>(ComponentHandlerWrapper.java:17)
        at 
demo.TagHandlerDelegateFactoryImpl.createComponentHandlerDelegate(TagHandlerDelegateFactoryImpl.java:34)
        at 
javax.faces.view.facelets.ComponentHandler.<init>(ComponentHandler.java:45)
        at demo.ComponentHandlerWrapper.<init>(ComponentHandlerWrapper.java:17)
        at 
demo.TagHandlerDelegateFactoryImpl.createComponentHandlerDelegate(TagHandlerDelegateFactoryImpl.java:34)
        ... omitted the rest

b) when composite component is used:


javax.faces.FacesException: java.lang.NullPointerException
        at 
org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
        at 
org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
        at 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
        at 
org.apache.myfaces.view.facelets.tag.composite.CompositeMetadataTargetImpl.<init>(CompositeMetadataTargetImpl.java:56)
        at 
org.apache.myfaces.view.facelets.tag.composite.CompositeMetaRulesetImpl.<init>(CompositeMetaRulesetImpl.java:85)
        at 
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentResourceTagHandler.createMetaRuleset(CompositeComponentResourceTagHandler.java:352)
        at 
org.apache.myfaces.view.facelets.tag.composite.CompositeComponentResourceTagHandler.setAttributes(CompositeComponentResourceTagHandler.java:343)
        at 
demo.ComponentHandlerWrapper.setAttributes(ComponentHandlerWrapper.java:58)
        at 
org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:208)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:54)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:59)
        at 
demo.ComponentHandlerWrapper.applyNextHandler(ComponentHandlerWrapper.java:30)
        at 
org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:263)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:54)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:59)
        at 
demo.ComponentHandlerWrapper.applyNextHandler(ComponentHandlerWrapper.java:30)
        at 
org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:263)
        at 
javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:54)
        at 
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
        at 
org.apache.myfaces.view.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:156)
        at 
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
        at 
org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57)
        at 
javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:51)
        at 
org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:45)
        at 
org.apache.myfaces.view.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:143)
        at 
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:311)
        at 
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:66)
        at 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
        ... 13 more


> Wrapping ComponentHandler in TagHandlerDelegateFactory conflicts with 
> implementation  
> --------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2888
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2888
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.0.2-SNAPSHOT
>            Reporter: Nick Belaevski
>            Priority: Critical
>         Attachments: jsf2test.zip
>
>
> When implementing my own TagHandlerDelegateFactory that wraps 
> ComponentHandler classes (this is necessary to handle custom behaviors 
> attachments) I encountered two problems:
> 1) StackOverflowError because TagHandlerDelegateFactory factory is called 
> again in the constructor of ComponentHandler, in order to initialize "helper" 
> field, however I don't need it for delegation
> 2) Composite components are broken because implementation is checking for 
> marker interfaces that are shadowed by wrappers

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to