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

MethodNotFoundException

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have been trying on a small sample on JSF. I used datatable with the binding attribute.Eventhough the submit button ie.Delete which is inside the datatable is working fine when i click on a button outside the datatable ie AddItem ..it throws an exception saying "javax.faces.el.MethodNotFoundException" . Here item is my managed bean

Attaching the sample here.Please HELP

<f:view>
<h:dataTable value="#{login.items}"
var="items" border="3" binding="#{item}" >
<h:column>
<f:facet name="header">
<f:verbatim>Id</f:verbatim>
</f:facet>
<h:commandButton value="Delete"
action="#{item.deleteItem}" />
</h:column>

<h:column>
<f:facet name="header">
<f:verbatim>Name</f:verbatim>
</f:facet>
<h:outputText value="#{items.name} " />
</h:column>
</h:dataTable>

<h:commandButton action="#{item.addNewItem}" value="Additem!"/>

</h:form>
</f:view>

Following is the exception:

com.sun.faces.lifecycle.InvokeApplicationPhase execute
SEVERE: #{item.addNewItem}: javax.faces.el.MethodNotFoundException: addNewItem: javax.faces.component.html.HtmlDataTable.addNewItem()
javax.faces.FacesException: #{item.addNewItem}: javax.faces.el.MethodNotFoundException: addNewItem: javax.faces.component.html.HtmlDataTable.addNewItem()
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.faces.el.MethodNotFoundException: addNewItem: javax.faces.component.html.HtmlDataTable.addNewItem()
at com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:206)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:124)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)


Please help me out !
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Doublepost: https://coderanch.com/t/414774/JSF/java/MethodNotFoundException
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic