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>