5 Replies Latest reply on Nov 6, 2007 10:23 AM by Neville Harrison

    PropertyNotFoundException,  problem with a EL-attribute mapp

    Vincent LAUGIER Newbie

      Hello,

      this surely is a very dumb mistake but I cannot find it

      I have a very simple entities model : one class Client

      In a first time, I am creating the clients (without defining the parentClient attribute) with an autogenerated CRUD form, this works

      I then want to list the generated clients in a datatable on an other page but I get the following error when going to the page :


      Bean: org.javassist.tmp.java.lang.Object_$$_javassist_79, property: clients
      - Stack Trace
      javax.el.PropertyNotFoundException: Bean: org.javassist.tmp.java.lang.Object_$$_javassist_79, property: clients
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:146)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:125)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:195)
       at com.sun.facelets.el.ELText$ELTextVariable.toString(ELText.java:174)
       at com.sun.facelets.el.ELText$ELTextComposite.toString(ELText.java:115)
       at com.sun.facelets.compiler.CommentInstruction.write(CommentInstruction.java:38)
       at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:280)
       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:524)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      



      Here is my entityBean :

      package portalInterventionPart.model;
      
      import java.io.Serializable;
      import javax.persistence.Entity;
      import javax.persistence.Id;
      import javax.persistence.GeneratedValue;
      import javax.persistence.Table;
      import javax.persistence.Version;
      import org.hibernate.validator.Length;
      
      @Entity
      @Table(name="CLIENT")
      
      public class Client implements Serializable {
      
       //seam-gen attributes (you should probably edit these)
       private Long id;
       private Integer version;
       private String name;
       private String title;
       private Client parent;
      
       //add additional entity attributes
      
       //seam-gen attribute getters/setters with annotations (you probably should edit)
      
       @Id @GeneratedValue
       public Long getId() {
       return id;
       }
      
       public void setId(Long id) {
       this.id = id;
       }
      
       @Version
       public Integer getVersion() {
       return version;
       }
      
       private void setVersion(Integer version) {
       this.version = version;
       }
      
       @Length(max=20)
       public String getName() {
       return name;
       }
      
       public void setName(String name) {
       this.name = name;
       }
      
       @Length(max=20)
       public String getTitle() {
       return title;
       }
      
       public void setTitle(String title) {
       this.title = title;
       }
      
       public Client getParent() {
       return parent;
       }
      
       public void setParent(Client parent) {
       this.parent = parent;
       }
      
      
      
      }
      
      




      Here is the parentMgr.xhtml :
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <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.ajax4jsf.org/rich"
       xmlns:a="https://ajax4jsf.dev.java.net/ajax"
       template="layout/template.xhtml">
      
      <ui:define name="body">
      
       <h:messages globalOnly="true" styleClass="message"/>
      
       <h:form id="parentMgrForm">
      
       <rich:panel>
       <f:facet name="header">parentMgr</f:facet>
      
       <h:dataTable value="#{parentMgr.clients}" var="client">
       <h:column>
       #{client.name}
       </h:column>
      
       </h:dataTable>
      
      
       <s:decorate id="valueDecoration" template="layout/edit.xhtml">
       <ui:define name="label">Value</ui:define>
       <h:inputText id="value" required="true"
       value="#{parentMgr.value}"/>
       </s:decorate>
      
       <div style="clear:both"/>
      
       </rich:panel>
      
       <div class="actionButtons">
       <h:commandButton id="parentMgr" value="parentMgr"
       action="#{parentMgr.parentMgr}"/>
       </div>
      
       </h:form>
      
      </ui:define>
      
      </ui:composition>
      



      And the ParentMgrBean.java
      package portalInterventionPart.model;
      
      import java.util.List;
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.log.Log;
      import org.jboss.seam.core.FacesMessages;
      import org.hibernate.validator.Length;
      import org.jboss.seam.annotations.Scope;
      
      import static org.jboss.seam.ScopeType.SESSION;
      import org.jboss.seam.annotations.Create;
      
      @Stateful
      @Name("parentMgr")
      @Scope(SESSION)
      
      public class ParentMgrBean implements ParentMgr {
      
       @PersistenceContext
       private EntityManager em;
      
       @Logger private Log log;
      
       @In FacesMessages facesMessages;
      
       //@DataModel
       private List<Client> clients ;
      
       private String value;
      
       public void parentMgr()
       {
       //implement your business logic here
       log.info("parentMgr.parentMgr() action called with: #{parentMgr.value}");
       facesMessages.add("parentMgr #{parentMgr.value}");
       }
      
      
       //add additional action methods
      
       @Length(max=10)
       public String getValue()
       {
       return value;
       }
      
       public void setValue(String value)
       {
       this.value = value;
       }
      
       public List<Client> getClients() {
       return clients;
       }
      
       public void setClients(List<Client> clients) {
       this.clients = clients;
       }
      
       //@Factory("clients")
       @Create
       public void find(){
       this.clients = em.createQuery("select c from Client c").getResultList();
       }
      
      
       @Destroy @Remove
       public void destroy() {}
      
      }
      



      I am using jboss4.0 with ejb3 support and sem 1.2.1


      thanks for your help