1 Reply Latest reply on May 11, 2009 11:37 AM by Manish Prajapati

    javax.faces.FacesException: javax.el.PropertyNotFoundException

    Manish Prajapati Newbie
      Hi All,

      I have created one seam component namely testTableManager and its both stateful and session scoped. (does stateful bean need to be session scoped?).Here, this component some properties which i want to access from the xhtml page but i am getting following error:

      javax.faces.FacesException: javax.faces.FacesException: javax.el.PropertyNotFoundException: /test/testTable.xhtml @74,105 colspan="#{sessionScope.testTableManager.conditionFields}": Property 'conditionFields' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_8
           at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1593)
           at org.ajax4jsf.renderkit.RendererUtils.encodePassThruAttribute(RendererUtils.java:393)
           at org.ajax4jsf.renderkit.RendererUtils.encodeAttributesFromArray(RendererUtils.java:413)
           at org.richfaces.renderkit.CellRenderer.doEncodeBegin(CellRenderer.java:80)
           at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
           at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
           at org.richfaces.renderkit.AbstractRowsRenderer.encodeCellChildren(AbstractRowsRenderer.java:285)
           at org.richfaces.renderkit.html.ColgroupRenderer.encodeChildren(ColgroupRenderer.java:98)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
           at org.richfaces.renderkit.AbstractRowsRenderer.encodeCellChildren(AbstractRowsRenderer.java:285)
           at org.richfaces.renderkit.AbstractRowsRenderer.encodeTableHeaderFacet(AbstractRowsRenderer.java:307)
           at org.richfaces.renderkit.AbstractTableRenderer.encodeHeader(AbstractTableRenderer.java:171)
           at org.richfaces.renderkit.AbstractTableRenderer.encodeTableStructure(AbstractTableRenderer.java:143)
           at org.richfaces.renderkit.html.DataTableRenderer.doEncodeBegin(DataTableRenderer.java:206)
           at org.richfaces.renderkit.html.DataTableRenderer.doEncodeBegin(DataTableRenderer.java:194)
           at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
           at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
           at javax.faces.component.UIData.encodeBegin(UIData.java:962)
           at org.ajax4jsf.component.UIDataAdaptor.encodeBegin(UIDataAdaptor.java:1220)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
           at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
           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 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:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           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:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
           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:828)
           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.faces.FacesException: javax.el.PropertyNotFoundException: /test/testTable.xhtml @74,105 colspan="#{testTableManager.conditionFields}": Property 'conditionFields' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_8
           at org.richfaces.component.html.HtmlColumn.getColspan(HtmlColumn.java:206)
           at sun.reflect.GeneratedMethodAccessor333.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1585)
           ... 82 more
      Caused by: javax.el.PropertyNotFoundException: /test/testTable.xhtml @74,105 colspan="#{testTableManager.conditionFields}": Property 'conditionFields' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_8
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)
           at org.richfaces.component.html.HtmlColumn.getColspan(HtmlColumn.java:204)
           ... 86 more

      Followings are my Backing bean interface and Implementing class:

      import java.util.List;

      import javax.ejb.Local;
      @Local
      public interface TestTableManager {
           public List<Object[]> testList();
           public  List<Column> testColumnList();
           public String  testData();
           public void remove();
           public void destroy();
      }

      Implementing Class:


      import java.io.FileNotFoundException;
      import java.io.IOException;
      import java.util.ArrayList;
      import java.util.HashMap;
      import java.util.List;
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import org.apache.poi.hssf.usermodel.HSSFCell;
      import org.apache.poi.hssf.usermodel.HSSFCellStyle;
      import org.apache.poi.hssf.usermodel.HSSFFont;
      import org.apache.poi.hssf.usermodel.HSSFRow;
      import org.apache.poi.hssf.usermodel.HSSFSheet;
      import org.apache.poi.hssf.usermodel.HSSFWorkbook;
      import org.apache.poi.hssf.util.HSSFColor;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Factory;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.faces.FacesMessages;
      import org.jboss.seam.log.Log;

      @Stateful
      @Name("testTableManager")
      @Scope(ScopeType.SESSION)
      public class TestTableManagerBean implements TestTableManager   {     
           private static List<String> possibleOperatorsList=new ArrayList<String>();
           static{
                possibleOperatorsList.add("<");
                possibleOperatorsList.add(">");
                possibleOperatorsList.add("<=");
                possibleOperatorsList.add(">=");
                possibleOperatorsList.add("==");
           }
           @Logger private Log log;

      ///////////Following is the property i am accessing from the .xhtml file////////////
           private int conditionFields;

           public int getConditionFields() {
                return conditionFields;
           }


           public void setConditionFields(int conditionFields) {
                this.conditionFields = conditionFields;
           }

           @In FacesMessages facesMessages; 
           
           
            @Factory(value="columnList",scope=ScopeType.PAGE)
            public List<Column> populateColumnList(){
               List<Column> columnList=new ArrayList<Column>();
               System.out.println("***** populateColumnList is called *******");
               try {
                Code to populate columnList

                .................
                .................
                .................
                          
                /*javax.servlet.http.HttpSession session=(HttpSession)facesContext.getContext().getExternalContext().getSession(true);
                session.setAttribute("conditionFileds", "4");
                session.setAttribute("Name","Test");*/
                     
                } catch (FileNotFoundException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                } catch (IOException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                }
               return columnList;
            }

           
           /*public List<List<Column>> getColumnList() {
                System.out.println("getTestTableColumnList is called, size is --> "+columnList.size());
                return columnList;
           }

           public void setColumnList(List<List<Column>> columnList) {
                System.out.println("***** setColumnList is called **** ");
                this.columnList = columnList;
           }
      */
           public String  populateData(){
                System.out.println("**** populateData is called **** ");
                populateList();
                populateColumnList();
                return "/test/testTable.xhtml";
           //     return "ruleEditor";
           }
           
           /**
            * We must provide this factory method to init the rowList instead of   
            * initiating it e.g. in a constructor because otherwise it would be   
            * uninitialized until this component itself - tichTable - is also   
            * used by the page using  rowList.     * <p>    
            * See Seam Reference 2.0.2 SP1, chapter 4.8. Factory and manager components.        
           */   
           @Factory(value="rowList",scope=ScopeType.PAGE) 
           public List<Object[]> populateList()
           {         
                
                List<Object[]>rowList=null;
           try{
                      
                //Code to populate rowList
                return rowList;
           }     
           public void  addInputField(){
                
           }
           @Remove
           public void remove() {
                // TODO Auto-generated method stub
                
           }     
           @Destroy
           public void destroy() {
                // TODO Auto-generated method stub
                
           }
      }

      Following is my .xhtml file:

      <h:form>
         
              <rich:dataTable value="#{rowList}" var="testTableObj" width="750">
              <f:facet name="header">
                              <rich:columnGroup>
                                 <rich:column>
                                      <rich:spacer />
                                  </rich:column>
                                  <rich:column colspan="#{testTableManager.conditionFields}">
                                      <h:outputText value="#{testTableManager.conditionFields}" />
                                  </rich:column>
                                  <rich:column colspan="4">
                                      <h:outputText value="Test1 Fields" />
                                  </rich:column>
                                   <rich:column colspan="4">
                                     <h:commandButton action="#{test}" value="Test2 Field" />
                                  </rich:column>
                              </rich:columnGroup>
               </f:facet>
         
                  
                  <rich:columns value="#{columnList}" var="colm" index="indx" width="200px" styleClass="#{colm.cssClass}"> 
                      <f:facet name="header">
                          <h:outputText value="#{colm.header}"/>
                      </f:facet>
                     <s:div>
                     <c:set var="test1" value="#{indx}"></c:set><!--
                     <c:if  test="#{test1 > 0}" var="result"/>
                     <c:if  test="#{((testTableObj[indx])[0]!='0')}" var="test2"/>
                    --><!--<c:set var="test2" value="#{((testTableObj[indx])[0]=='0')}"></c:set>
                    --><!--<c:set var="test2" value="#{result}"></c:set>-->
                    <c:set var="test2" value="#{(testTableObj[indx])[0]}"></c:set>
                    <!--<c:if  test="#{(testTableObj[indx])[0] == 0}" var="result"/>-->
                             
                    <c:if test="#{colm.isCondition}">                   
                       <rich:comboBox defaultLabel="Enter some value" value="#{(testTableObj[indx])[0]}" width="35px" >
                            <f:selectItem itemValue=">"/>
                            <f:selectItem itemValue="&lt;"/>
                            <f:selectItem itemValue=">="/>
                            <f:selectItem itemValue="=="/>
                           </rich:comboBox>
                        </c:if>
                      <c:choose>
                          <c:when test="#{indx > 0}">
                                  <h:inputText value="#{(testTableObj[indx])[1]}" size="6" />
                            </c:when>
                          <c:otherwise>
                                  <h:outputText value="#{(testTableObj[indx])[1]}" size="6" />
                            </c:otherwise>
                     </c:choose>

                     </s:div>
                  </rich:columns>
              </rich:dataTable>
          </h:form>

      Please, help me to resolve this PropertyNotFoundException.

      Also tell me if i want to use following code for storing the session, will it work?

           Code nto seam component which is of Event or Conversation scope:     

           /*javax.servlet.http.HttpSession session=(HttpSession)facesContext.getContext().getExternalContext().getSession(true);
           session.setAttribute("conditionFileds", "4");
           session.setAttribute("Name","Test");*/
      Code to access Session attributes from the .xhtml page:
      <h:outputText value="#{sessionScope.Name}" size="6" />

      Its urgent to get this PropertyNotFoundException to be solved so help me out.

      Thanks a lot in advance.

      Regards,
      Manish