Error setting property 'myFile' in bean of type null

Hi All, I am having problem accessing jsf bean, I have wrote a simple jsf page with h : form and input text and command button. in bean i have getter and setter methods for a variable and an action method. First jsf form displays fine but when I input a value in text box and clicks on a command buitton following error occurs,exception javax.servlet.ServletException: Error testing property 'myMsg' in bean of type null at javax.faces.webapp.FacesServlet.service(FacesServlet.java:209) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) Root Cause javax.faces.el.PropertyNotFoundException: Error testing property 'myMsg' in bean of type null at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:342) at com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:235) at com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:203) at com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:307) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:110) at javax.faces.component.UIInput.validate(UIInput.java:679) at javax.faces.component.UIInput.executeValidate(UIInput.java:796) at javax.faces.component.UIInput.processValidators(UIInput.java:412) at javax.faces.component.UIForm.processValidators(UIForm.java:165) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:905) at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:341) at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200) This is my JSF page <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> Welcome Page Bean: package messagebean; import net.sf.hibernate.*; import net.sf.hibernate.cfg.*; public class HiberBean { private String myMsg; public void setMyMsg(String myMsg) { this.myMsg = myMsg; } public String getMyMsg() { return this.myMsg; } public String saveMsg() { setMyMsg(myMsg); System.out.println(getMyMsg()); return "finish"; } } Please advise! Thanks


your faces-config.xml?


you need initialize your mymsg in you bean