2 Replies Latest reply on Dec 28, 2007 9:32 AM by Timo Kuchheuser

    javax.el.PropertyNotFoundException

    Timo Kuchheuser Newbie

      Hello everyone,

      i've got a problem with some code (mainly copied from the booking example).
      I use Jboss AS 4.2.2 with SEAM 2.0.0.
      The Booking-Example works fine.

      However my own page pr_overview.xhtml:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"
       xmlns:a4j="http://richfaces.org/a4j">
      
       <ui:define name="body">
      
       <h:messages globalOnly="true" styleClass="message" />
       <br />
       <rich:panel>
       <f:facet name="header">Probandenübersicht</f:facet>
       <rich:panel>
       <h:form id="searchCriteria">
       <h:panelGrid columns="4">
       <h:outputText value="Name: " />
       <h:inputText id="searchStringName"
       value="#{subjectSearch.searchString}" />
      
       <a4j:commandButton value="Suche" id="findSubjects"
       action="#{subjectSearch.runQuery}" reRender="searchResults" />
       </h:panelGrid>
       </h:form>
       </rich:panel>
      


      with the backing bean:


      import java.util.List;
      
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.datamodel.DataModel;
      
      import de.itecra.pdb.model.Proband;
      
      @Stateful
      @Name("subjectSearch")
      @Scope(ScopeType.SESSION)
      public class SubjectSearchAction implements SubjectSearch {
      
       @Logger("SubjectSearch")
       org.jboss.seam.log.Log log;
      
       @PersistenceContext
       private EntityManager em;
      
       @DataModel
       private List<Proband> listSubjectsResults;
      
       /** SEARCH FIELDS */
       private String searchString;
      
       /** METHODS */
       public void runQuery() {
      
       listSubjectsResults = em.createQuery("FROM Proband").getResultList();
       log.info("RunQuery");
       }
      
       /** GETTERS AND SETTERS */
       public String getSearchString() {
       return searchString;
       }
      
       public void setSearchString(String searchString) {
       this.searchString = searchString;
       }
      
       /** COMMON METHODS */
      
       @Remove
       @Destroy
       public void destroy() {
       }
      
      }
      
      


      throws the exception:



      javax.faces.FacesException: javax.el.PropertyNotFoundException: /pr_overview.xhtml @23,48 value="#{subjectSearch.searchString}": Property 'searchString' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_0
      at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
      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 com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)
      at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      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:199)
      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
      at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      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:199)
      at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
      at org.ajax4jsf.renderkit.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:592)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

      [...]



      However using the runQuery() Method and accesing listSubjectResults works fine:
      <a4j:commandButton value="Suche" id="findSubjects"
       action="#{subjectSearch.runQuery}" reRender="searchResults" />
      


      <a4j:outputPanel id="searchResults">
       <rich:dataTable id="subjects" value="#{listSubjectsResults}"
       var="subject" rendered="#{listSubjectsResults.size>0}">
       <rich:column>
       <f:facet name="header">Nachname</f:facet>
       #{subject.nachname}
       </rich:column>
       <rich:column>
       <f:facet name="header">Vorname</f:facet>
       #{subject.vorname}
       </rich:column>
       <rich:column>
       <f:facet name="header">Geburtsdatum</f:facet>
       <h:outputText value="#{subject.geburtsdatum}">
       <s:convertDateTime pattern="DD.MM.yyyy" />
       </h:outputText>
       </rich:column>
       <rich:column>
       <f:facet name="header">Identifikation</f:facet>
       #{subject.code_zahl}
       </rich:column>
       <rich:column>
       <f:facet name="header">Aktion</f:facet>
       <s:link value="Öffnen" id="openSubject" />
       <!--
       <s:link value="Untersuchung" />
       <s:link value="Studie" />
       -->
       </rich:column>
       </rich:dataTable>
       </a4j:outputPanel>
      
      


      Idea anyone?
      Thanks for advice or links.


      Timo