title: javax.el.ELException: java.lang.UnsupportedOperationException at java.util.AbstractList.add
body: <p>On Wildfly 9 (JSF 2.2, EL 3.0) I have two nested <code>&lt;ui:repeat&gt;</code> tags and want to use the var attribute of the outer one as method argument for the inner:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ui:repeat value="#{bean.getEntries()}" var="entry"&gt;
      &lt;ui:repeat value="#{bean.getPosts(entry)}" var="post"&gt;
          &lt;p id="text"&gt;#{post.text}&lt;/p&gt;
      &lt;/ui:repeat&gt;
  &lt;/ui:repeat&gt;
  </code></pre>
  
  <p><code>bean.getEntries()</code> returns <code>List&lt;Entry&gt;</code> and <code>bean.getPosts(Entry entry)</code> returns <code>List&lt;Post&gt;</code> as one would expect.</p>
  
  <p>But instead of some <code>&lt;p&gt;</code> tags filled with posts I get an exception:</p>
  
  <pre><code>11:24:26,574 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-2) Error Rendering View[/index.xhtml]: javax.el.ELException: /WEB-INF/templates/diary.xhtml @14,73 value="#{sessionBean.getPublicPosts(elEntry)}": java.lang.UnsupportedOperationException
  at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
  at com.sun.faces.facelets.component.UIRepeat.getValue(UIRepeat.java:279)
  at com.sun.faces.facelets.component.UIRepeat.getDataModel(UIRepeat.java:255)
  at com.sun.faces.facelets.component.UIRepeat.setIndex(UIRepeat.java:523)
  at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:577)
  at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1110)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
  at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104)
  at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:621)
  at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1110)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
  at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
  at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:655)
  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)
  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)
  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)
  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)
  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  Caused by: javax.el.ELException: java.lang.UnsupportedOperationException
  at javax.el.ELUtil.invokeMethod(ELUtil.java:312)
  at javax.el.BeanELResolver.invoke(BeanELResolver.java:537)
  at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
  at com.sun.el.parser.AstValue.getValue(AstValue.java:136)
  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 org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
  at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
  ... 49 more
  Caused by: java.lang.UnsupportedOperationException
  at java.util.AbstractList.add(AbstractList.java:148)
  at java.util.AbstractList.add(AbstractList.java:108)
  at org.bollin.diary.util.SessionBean.getPublicPosts(SessionBean.java:124)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at javax.el.ELUtil.invokeMethod(ELUtil.java:308)
  ... 57 more
  
  11:24:26,580 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /diary/index.jsf: javax.servlet.ServletException
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:667)
  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)
  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)
  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)
  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)
  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.UnsupportedOperationException
  at java.util.AbstractList.add(AbstractList.java:148)
  at java.util.AbstractList.add(AbstractList.java:108)
  at org.bollin.diary.util.SessionBean.getPublicPosts(SessionBean.java:124)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at javax.el.ELUtil.invokeMethod(ELUtil.java:308)
  at javax.el.BeanELResolver.invoke(BeanELResolver.java:537)
  at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
  at com.sun.el.parser.AstValue.getValue(AstValue.java:136)
  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 org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
  at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
  at com.sun.faces.facelets.component.UIRepeat.getValue(UIRepeat.java:279)
  at com.sun.faces.facelets.component.UIRepeat.getDataModel(UIRepeat.java:255)
  at com.sun.faces.facelets.component.UIRepeat.setIndex(UIRepeat.java:523)
  at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:577)
  at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1110)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
  at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104)
  at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:621)
  at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1110)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
  at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
  at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
  at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:655)
  ... 27 more
  </code></pre>