[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1756) Calling resultList.size() on framework entity-query with max-results= set gives error
Gavin King (JIRA)
jira-events at lists.jboss.org
Sat Aug 4 13:01:49 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1756?page=comments#action_12371136 ]
Gavin King commented on JBSEAM-1756:
------------------------------------
Yes, that was my guess. Apparently JBoss EL needs to call setAccessible() on the SubList class, or else search its interfaces.
> Calling resultList.size() on framework entity-query with max-results= set gives error
> -------------------------------------------------------------------------------------
>
> Key: JBSEAM-1756
> URL: http://jira.jboss.com/jira/browse/JBSEAM-1756
> Project: JBoss Seam
> Issue Type: Bug
> Components: EL
> Affects Versions: 2.0.0.BETA1
> Environment: JBoss-4.2.1.GA
> Reporter: David Spark
>
> I'm trying to get the number of results from the following query (in components.xml):
> Code: <framework:entity-query
> name="clients"
> ejbql="SELECT c FROM Client c"
> max-results="20"/>
> And this is in my page:
> Code: <h:outputText value="#{clients.resultList.size()} clients available"/>
> But when I try to load the page I get the following error (I also use the query to create a dataTable and that works fine):
> javax.faces.FacesException: javax.el.ELException: /clientSelect.xhtml @14,77 value="#{clients.resultList.size()} clients available": java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a member o
> f class java.util.SubList with modifiers "public"
> at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
> at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
> 89)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
> at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
> at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
> at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
> at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
> at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
> )
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
> at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
> Caused by: javax.el.ELException: /clientSelect.xhtml @14,77 value="#{clients.resultList.size()} clients available": java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a member o
> f class java.util.SubList with modifiers "public"
> at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
> at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
> at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
> 89)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
> at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
> at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
> at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
> at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
> at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
> )
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
> at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
> at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> Caused by: java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a
> member of class java.util.SubList with modifiers "public"
> at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
> at java.lang.reflect.Method.invoke(Method.java:578)
> at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
> at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:270)
> at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
> at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
> at org.jboss.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:26)
> at org.jboss.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:31)
> at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
> at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
> at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
> at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
> 89)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
> at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
> at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
> at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
> at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
> at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
> at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
> at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
> at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
> at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
> )
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> Here is the patch to reproduce
> Code:
> ### Eclipse Workspace Patch 1.0
> #P jboss-seam
> Index: examples/ui/resources/WEB-INF/components.xml
> ===================================================================
> RCS file: /cvsroot/jboss/jboss-seam/examples/ui/resources/WEB-INF/components.xml,v
> retrieving revision 1.9
> diff -u -r1.9 components.xml
> --- examples/ui/resources/WEB-INF/components.xml 1 Aug 2007 11:49:57 -0000 1.9
> +++ examples/ui/resources/WEB-INF/components.xml 3 Aug 2007 12:11:52 -0000
> @@ -21,7 +21,7 @@
>
> <framework:entity-home name="personHome" entity-class="org.jboss.seam.example.ui.Person" />
>
> - <framework:entity-query name="colours" ejbql="select c from Colour c" />
> + <framework:entity-query name="colours" ejbql="select c from Colour c" max-results="2" />
>
> <framework:entity-query name="books" ejbql="select b from Book b" />
>
> Index: examples/ui/view/index.xhtml
> ===================================================================
> RCS file: /cvsroot/jboss/jboss-seam/examples/ui/view/index.xhtml,v
> retrieving revision 1.4
> diff -u -r1.4 index.xhtml
> --- examples/ui/view/index.xhtml 13 Jun 2007 23:49:05 -0000 1.4
> +++ examples/ui/view/index.xhtml 3 Aug 2007 12:11:52 -0000
> @@ -10,5 +10,6 @@
> <ui:param name="tagName" value="" />
> <ui:define name="body">
> <p>Seam ui components</p>
> + <h:outputText value="#{colours.resultList.size()}" />
> </ui:define>
> </ui:composition>
> \ No newline at end of file
> And visit the index.xhtml page on the ui example
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list