I have not yet isolated this as a dedicated test case, and the XHTML/JSF code is far too complex to reproduce here (being the reason I used ui:include) but I can at least describe it so that if somebody else encounters the same strange problem they know where to look.
I have two composite components, let's call them A and B.
They both involve very large complex p:dataTable, but slightly different, yet share exactly many of the p:column. So for the sake of Don't Repeat Yourself (DRY) coding I used a ui:include of the multiple p:column into both of the 2 separate CCs, A and B.
This worked fine for a couple of days. I kept working on the mutually included section, introducing new p:column columns, then suddenly started getting StackOverflowError errors:
Code: Select all
java.lang.StackOverflowError
at com.sun.el.lang.EvaluationContext.getContext(EvaluationContext.java:91)
at com.sun.faces.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:110)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:180)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:208)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116)
at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at com.sun.faces.facelets.el.ContextualCompositeValueExpression.getValue(ContextualCompositeValueExpression.java:159)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:115)
at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2487)
at com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap.get(CompositeComponentAttributesELResolver.java:405)
at javax.el.MapELResolver.getValue(MapELResolver.java:199)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:180)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:208)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at com.sun.faces.facelets.el.ContextualCompositeValueExpression.getValue(ContextualCompositeValueExpression.java:159)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:115)
at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2487)
at com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap.get(CompositeComponentAttributesELResolver.java:405)
at javax.el.MapELResolver.getValue(MapELResolver.java:199)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:180)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:208)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
Then I thought to simply comment out the ui:include from both "client" CCs, A and B, and paste the complex multiple-column p:column code back into A, and it all worked fine. I then pasted it also into B, and it still worked fine.
It's reproducible. Something about using the ui:include across the multiple p:column is throwing it, and I could not yet find out what (the culprit included code looks innocent to me, but as said, way too complex to show here).
A crying shame, as the ui:include included code is very complex, and reproducing/editing/managing it it in two different CC contexts is labourious and horribly WET (Write Everything Twice, a.k.a. We Enjoy Typing).
Q1: Can anyone think of anything that could cause this ?
Q2: Is there anyway to encapsulate just the p:column aspect of multiple columns within a p:dataTable as a composite component ?
I would be surprised if anybody can answer Q1 without some tricky testing. It's a pathological gotcha.
I would be very suprised if there is a solution to Q2.
Will try to isolate it as a test case, but for now the questions stand as described.
Also, don't know whether it happens anyway with h:column (might be something about JSF vs p:dataTable or might not have anything to do with PrimeFaces at all).