wood burning stoves 2.0*
The moose likes JSF and the fly likes JSF property not found exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF property not found exception" Watch "JSF property not found exception" New topic
Author

JSF property not found exception

t kk
Greenhorn

Joined: May 19, 2005
Posts: 5
Hi All,
I am new to JSF and trying run a simple programme, this pgm accepts a string from user and displays it to console.
I wrote a simple jsf form with input text and its value is assigned to a variable in bean, whrn I run the pgm first page displays fine but whne I click on save button following error occurs.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 src.filters.OlySecurityFilter.doFilter(OlySecurityFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
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)


HEre is my code
JSF
<body>
<f:view>
<h:form id="loginForm">
<h utputText value="Input Your Message" />
<h:inputText value="#{hiberBean.myMsg}" id="myMsg"/>
<h:commandButton value="Save" action="#{hiberBean.saveMsg}" />
</h:form>
</h3>
</f:view>

Bean
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";

}
}

Bean is defined in faces-config as well

Now how do I resolve this?
PLease help

Thanks
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
JSF is not able to find your bean, show managed bean configuration and more error log.


- Varun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF property not found exception