Topic
  • 3 replies
  • Latest Post - ‏2012-07-09T06:37:30Z by SystemAdmin
SystemAdmin
SystemAdmin
6420 Posts

Pinned topic javax.faces.el.PropertyNotFoundException

‏2012-06-21T13:48:14Z |
Hi,

I'm using IBM Rational® Application Developer for WebSphere® Software 8.0.3, Webspere Portal v6.1 Server and studying on Windows XP.

Trying to use commandlink on a datatable. I have an arraylist which include departmentDef objects. Each object's definition is a commandlink. When clicking on commandlink I get the clicked object's departmentcode as parameter, find the object with departmentcode from database and set a managed bean in the same page.

I have a form in the same page and i want to fill in the form with that managed bean after clicking the commandlink.
I got the following exception.
But when trying to write the value of departmentCode to stdout from managed bean without filling the form i saw the correct value.
6/21/12 16:23:16:416 EEST 0000003c SystemErr R javax.faces.FacesException: Error testing property 'departmentCode' in bean of type null
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:89)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.faces.portlet.FacesPortlet.processAction(FacesPortlet.java:202)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:77)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.wps.propertybroker.standard.filter.PropertyBrokerActionFilter.doFilter(PropertyBrokerActionFilter.java:731)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.wps.propertybroker.standard.filter.C2APortletFilter.doFilter(C2APortletFilter.java:166)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.wps.engine.dpr.portlet.impl.ProcessActionMemoFilter.doFilter(ProcessActionMemoFilter.java:88)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:527)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:114)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.isclite.container.collaborator.PortletServletCollaborator.doAction(PortletServletCollaborator.java:56)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doAction(RRDServerPortletServletCollaborator.java:117)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.cache.CacheCollaborator.doAction(CacheCollaborator.java:84)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.wps.pe.pc.waspc.core.impl.PortletServletCollaboratorImpl.doAction(PortletServletCollaboratorImpl.java:146)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:301)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:82)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.isclite.container.collaborator.PortletServletCollaborator.doDispatch(PortletServletCollaborator.java:124)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doDispatch(RRDServerPortletServletCollaborator.java:60)
6/21/12 16:23:16:416 EEST 0000003c SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)

What is wrong i am doing, is anyone run into the same problem?

Thank you in advance..
Updated on 2012-07-09T06:37:30Z at 2012-07-09T06:37:30Z by SystemAdmin
  • bobreaman
    bobreaman
    7 Posts

    Re: javax.faces.el.PropertyNotFoundException

    ‏2012-06-26T18:26:40Z  
    Little bit of jsf code block will help to understand your problem.

    Old jsf el has bug related to second char camel case, take a look into link below, might related to your issue.
    http://www.jroller.com/mert/entry/a_bug_about_el_binding
  • SystemAdmin
    SystemAdmin
    6420 Posts

    Re: javax.faces.el.PropertyNotFoundException

    ‏2012-07-09T06:34:48Z  
    • bobreaman
    • ‏2012-06-26T18:26:40Z
    Little bit of jsf code block will help to understand your problem.

    Old jsf el has bug related to second char camel case, take a look into link below, might related to your issue.
    http://www.jroller.com/mert/entry/a_bug_about_el_binding
    Thank you for your answer. I read the article you given in url. But it is for problems which first 2 letter should be capalitized.

    Here is a part of my jsp code;
    <table width="100%">
    <tr>
    <th><h:outputText styleClass="outputText" id="text3"
    value="#{msg.cd_CODE}"></h:outputText>
    </th>
    <td><h:inputText styleClass="inputText" id="departmentCode"
    readonly="#{pc_CreateDepartmentView.codeRendered}"
    disabled="#{pc_CreateDepartmentView.codeRendered}"
    value="#{createDepartmentSession.department.departmentCode}">

    </h:inputText>
    </td>
    </tr>
    <tr>
    <th><h:outputText styleClass="outputText" id="text4"
    value="#{msg.cd_DEPT_TITLE}"></h:outputText></th>
    <td><h:inputText styleClass="inputText" id="definition"
    value="#{createDepartmentSession.department.definition}"></h:inputText>
    </td>
    </tr>
    <tr>
    <th><h:outputText styleClass="outputText" id="text5"
    value="#{msg.cd_LANGUAGE}"></h:outputText></th>
    <td><h:selectOneMenu styleClass="selectOneMenu"
    id="applLangCode">
    <f:selectItems id="selectItems1"
    value="#{selectitems.pc_CreateDepartmentView.languageList.languageDef.languageDef.toArray}" />
    </h:selectOneMenu>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="right" valign="top"><hx:commandExButton type="submit"
    value="#{msg.BUTTON_ADD}" styleClass="commandExButton"
    id="buttonAdd"
    action="#{pc_CreateDepartmentView.doButtonAddAction}"></hx:commandExButton>

    </td>
    </tr>
    </table>
  • SystemAdmin
    SystemAdmin
    6420 Posts

    Re: javax.faces.el.PropertyNotFoundException

    ‏2012-07-09T06:37:30Z  
    • bobreaman
    • ‏2012-06-26T18:26:40Z
    Little bit of jsf code block will help to understand your problem.

    Old jsf el has bug related to second char camel case, take a look into link below, might related to your issue.
    http://www.jroller.com/mert/entry/a_bug_about_el_binding
    And my POJO is
    import java.io.Serializable;
    import javax.persistence.*;
    import java.util.Set;
    /**
    * The persistent class for the Department database table.
    *
    */
    @Entity
    public class Department implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name="DepartmentCode")
    private int departmentCode;

    //bi-directional many-to-one association to Dt
    @OneToMany(mappedBy="department")
    private Set<Dt> dts;

    //bi-directional many-to-one association to DepartmentDef
    @OneToMany(mappedBy="department")
    private Set<DepartmentDef> departmentDefs;

    //bi-directional many-to-one association to DepartmentUser
    @OneToMany(mappedBy="department")
    private Set<DepartmentUser> departmentUsers;

    //bi-directional many-to-one association to Project
    @OneToMany(mappedBy="department")
    private Set<Project> projects;

    //bi-directional many-to-one association to Task
    @OneToMany(mappedBy="department")
    private Set<Task> tasks;

    public Department() {
    }

    public int getDepartmentCode() {
    return this.departmentCode;
    }

    public void setDepartmentCode(int departmentCode) {
    this.departmentCode = departmentCode;
    }

    public Set<Dt> getDts() {
    return this.dts;
    }

    public void setDts(Set<Dt> dts) {
    this.dts = dts;
    }

    public Set<DepartmentDef> getDepartmentDefs() {
    return this.departmentDefs;
    }

    public void setDepartmentDefs(Set<DepartmentDef> departmentDefs) {
    this.departmentDefs = departmentDefs;
    }

    public Set<DepartmentUser> getDepartmentUsers() {
    return this.departmentUsers;
    }

    public void setDepartmentUsers(Set<DepartmentUser> departmentUsers) {
    this.departmentUsers = departmentUsers;
    }

    public Set<Project> getProjects() {
    return this.projects;
    }

    public void setProjects(Set<Project> projects) {
    this.projects = projects;
    }

    public Set<Task> getTasks() {
    return this.tasks;
    }

    public void setTasks(Set<Task> tasks) {
    this.tasks = tasks;
    }
    and my departmentDef object
    import java.io.Serializable;
    import javax.persistence.*;
    /**
    * The persistent class for the DepartmentDef database table.
    *
    */
    @Entity
    public class DepartmentDef implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="DepartmentDefId")
    private int departmentDefId;

    @Column(name="Definition")
    private String definition;

    //bi-directional many-to-one association to Department
    @ManyToOne
    @JoinColumn(name="DepartmentCode")
    private Department department;

    //bi-directional many-to-one association to ApplicationLanguage
    @ManyToOne
    @JoinColumn(name="ApplLangCode")
    private ApplicationLanguage applicationLanguage;

    public DepartmentDef() {
    }

    public int getDepartmentDefId() {
    return this.departmentDefId;
    }

    public void setDepartmentDefId(int departmentDefId) {
    this.departmentDefId = departmentDefId;
    }

    public String getDefinition() {
    return this.definition;
    }

    public void setDefinition(String definition) {
    this.definition = definition;
    }

    public Department getDepartment() {
    return this.department;
    }

    public void setDepartment(Department department) {
    this.department = department;
    }

    public ApplicationLanguage getApplicationLanguage() {
    return this.applicationLanguage;
    }

    public void setApplicationLanguage(ApplicationLanguage applicationLanguage) {
    this.applicationLanguage = applicationLanguage;
    }

    }