2 Replies Latest reply on Feb 18, 2011 1:23 PM by Serkan Eskici

    ELException:...Error reading 'resultList'...

    Dmitri Zakharov Newbie

      Hello everybody,


      I have a CRUD project prototype generated from existing database with Seam (2.1.1.GA) running on JBoss 5.0.1.GA and using DB2AS400 as a database. It allows to view claims. When I go to ClaimList.xhtml page (which contains search filters and result table), type in value in one of search filters and click Search button I get an error.


      The full stack trace is below at the end of message. The error says:


      javax.faces.FacesException: javax.el.ELException: /ClaimList.xhtml @57,58 rendered="#{empty claimList.resultList}": Error reading 'resultList' on type com.fedextnc.credits.action.ClaimList_$$_javassist_2



      Line 57 in ClaimList.xhtml is using EL expression as follows:


      56: <h:outputText value="The claim search returned no results."
      57:     rendered="#{empty claimList.resultList}"/>



      According to stack trace the error is happening earlier with the cause:


      Caused by: java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@f2d56b



      But the strange thing is if I browse the other pages in the genetared project and than return to ClaimList.xhtml and do search again it works. It seams claimList.resultList is not properly initialized first time.


      Did anybody experienced the same problem? How to make sure that claimList.resultList is initialized properly? Any possible solutions, suggestions and leads are really appreciated.


      The claimList (ClaimList.java) was generated by seam as follows:


      import com.domain.credits.model.*;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.framework.EntityQuery;
      import java.util.Arrays;
      
      @Name("claimList")
      public class ClaimList extends EntityQuery<Claim> {
          private static final String EJBQL = "select claim from Claim claim";
      
          private static final String[] RESTRICTIONS = {
           "lower(claim.documentNumber) like concat(lower(#{claimList.claim.documentNumber}),'%')",
           "lower(claim.adjustmentNumber) like concat(lower(#{claimList.claim.adjustmentNumber}),'%')",
           "lower(claim.shipmentNumber) like concat(lower(#{claimList.claim.shipmentNumber}),'%')",
           "lower(claim.importerName) like concat(lower(#{claimList.claim.importerName}),'%')",};
      
          private Claim claim = new Claim();
      
          public ClaimList() {
           setEjbql(EJBQL);
           setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
           setMaxResults(25);
          }
          public Claim getClaim() {
           return claim;
          }
      }



      Here's the stack trace of the error I get the first time I click Search button:


      javax.faces.FacesException: javax.el.ELException: /ClaimList.xhtml @57,58 rendered="#{empty claimList.resultList}": Error reading 'resultList' on type com.fedextnc.credits.action.ClaimList_$$_javassist_2
           at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:393)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
           at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           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.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.el.ELException: /ClaimList.xhtml @57,58 rendered="#{empty claimList.resultList}": Error reading 'resultList' on type com.fedextnc.credits.action.ClaimList_$$_javassist_2
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
           at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
           ... 58 more
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
           at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:74)
           at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65)
           at sun.reflect.GeneratedMethodAccessor3200.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.fedextnc.credits.action.ClaimList_$$_javassist_2.getResultList(ClaimList_$$_javassist_2.java)
           at sun.reflect.GeneratedMethodAccessor3199.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
           at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
           at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           ... 59 more
      Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
           at org.hibernate.loader.Loader.doList(Loader.java:2231)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
           at org.hibernate.loader.Loader.list(Loader.java:2120)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
           ... 90 more
      Caused by: java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@f2d56b
           at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:81)
           at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:237)
           at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
           at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
           at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
           at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
           at org.hibernate.loader.Loader.doQuery(Loader.java:696)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
           at org.hibernate.loader.Loader.doList(Loader.java:2228)
           ... 98 more