0

I am new to java EE and JSF 2.2, and I encountered this problem "javax.el.PropertyNotFoundException: Target Unreachable, identifier 'registerEmployeeBean' resolved to null" when I tried to run my code. But when my teammate commits this code to his local copy, it works perfectly fine for him. I have googled many times, but nothing could help me as of now. I am currently running glassfish 4.0 on netbeans 8.0. Please kindly advise.

Here is my code for my managedbean

@Named(value = "registerEmployeeBean")
@SessionScoped
public class registerEmployeeBean implements Serializable{
   @EJB
   private EmployeeManagementLocal emb;

   private Long idEmployees;
   private String name;
   private String password;
   private String status;

   public registerEmployeeBean() {
   }

   //getters and setters

   public void addEmployee(ActionEvent evt) {
      emb.addEmployee(new Employees(idEmployees, name, password, status));
   }

This is my code for xhtml calling the bean

<h:form id="testFilterForm">
        <h:outputLabel>Employee ID:</h:outputLabel>
        <h:inputText id ="idEmployees" value="#{registerEmployeeBean.idEmployees}" />
        <br/>
        <h:outputLabel>Name:</h:outputLabel>
        <h:inputText id ="name" value="#{registerEmployeeBean.name}" />
        <br/>
        <h:outputLabel>Password:</h:outputLabel>
        <h:inputText id ="password" value="#{registerEmployeeBean.password}" />
        <br/>
        <h:outputLabel>Status:</h:outputLabel>
        <h:inputText id ="status" value="#{registerEmployeeBean.status}" />
        <h:commandButton id ="submit" value="Submit" actionListener#{registerEmployeeBean.addEmployee}" />

My web.xml

 <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>faces/page.xhtml</welcome-file>
</welcome-file-list>
</web-app>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
ayampenyet
  • 241
  • 1
  • 2
  • 15
  • Post your *beans.xml* file here – kolossus Aug 27 '14 at 20:11
  • Try restart your app server... – Cold Aug 28 '14 at 08:10
  • Oh, man! I ran into the same problem. Then I created a new project and copied all the code exactly the same to the new one and it worked. But now again the same thing! Great advice, I restarted the server and it's working again. What an annoying bug! Clean&Build and then Run did not help. (Netbeans 8.0.2/Glassfish 4.1) – Palo Jan 02 '15 at 18:08

0 Answers0