• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF property not found exception

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF is not able to find your bean, show managed bean configuration and more error log.
reply
    Bookmark Topic Watch Topic
  • New Topic