File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF property not found exception

 
t kk
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1400
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF is not able to find your bean, show managed bean configuration and more error log.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic