4 Replies Latest reply on Jan 12, 2011 9:32 AM by Olalekan Ogunleye

    MethodNotFoundException

    Olalekan Ogunleye Newbie
      Hi all,

      Please, I need your help on the above error. This is making my head to swing. Below are the extracts of my code

      .xhtml
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j"
          template="layout/template.xhtml">

      <ui:define name="body">
           <a4j:keepAlive beanName="valueChangeManager.valueChanges()"></a4j:keepAlive>
          <h:form id="serviceForm">
                 
                  <rich:panel>
                      <f:facet name="header">Configure Service for New Subscriber</f:facet>
                      <h:panelGrid columns="1">
                      <s:decorate id="nameDecoration" template="layout/edit.xhtml">
                        <ui:define name="label">Select Service:</ui:define>
                        <rich:comboBox value="#{valueChangeManager.state}" valueChangeListener="#{valueChangeManager.valueChanges()}">
                              <f:selectItem itemValue="" />
                           <f:selectItem itemValue="keyword" />
                             <f:selectItem itemValue="sms" />
                              <f:selectItem itemValue="c3to" />
                              <a4j:support event="onchange" reRender="wrap1,wrap2,wrap3"></a4j:support>
                        </rich:comboBox>
                      </s:decorate>
                      </h:panelGrid>
                  </rich:panel>
                 
                  <h:panelGroup id="wrap1">
                  <h:panelGroup rendered="#{valueChangedBean.state=='keyword'}">
                   11111
                  </h:panelGroup>
                  </h:panelGroup>
                 
                  <h:panelGroup id="wrap2">
                  <h:panelGroup rendered="#{valueChangedBean.state=='sms'}">
                   22222
                  </h:panelGroup>
                  </h:panelGroup>
                 
                  <h:panelGroup id="wrap3">
                  <h:panelGroup rendered="#{valueChangedBean.state=='c3to'}">
                   33333
                  </h:panelGroup>
                  </h:panelGroup>
                 
                  <div class="actionButtons">
                      <h:commandButton id="GO"
                                       value="GO"
                                       action="#{comboBoxValueChange.valueChanged}"/>                  
                     
                      <s:button propagation="end"
                                id="done"
                                value="Cancel"
                                view="/"/>
                  </div>
                 
              </h:form>


      </ui:define>

      </ui:composition>



      component
      package sammy.topsy

      import java.io.Serializable;
      import org.jboss.seam.annotations.Name;

      @Name("valueChangeManager")
      public class ValueChangedBean implements Serializable {
           private String state="";
           /**
            *
            */
           private static final long serialVersionUID = 1L;
           
           public void valueChanges(javax.faces.event.ValueChangeEvent e) {
                if (e.getNewValue().equals("keyword")) {
                     state=("keyword");
                     //e.getNewValue();
                }else if (e.getNewValue().equals("sms")) {
                     state=("sms");
                     //e.getNewValue();
                }else if (e.getNewValue().equals("c3t0")) {
                     state=("c3t0");
                     //e.getNewValue();
                }
                state=e.getNewValue().toString();
           }
           
           public String getState() {
                return state;
           }
           public void setState(String state) {
                this.state = state;
           }
           
      }

      Jboss Error Log

      ERROR [viewhandler] Error Rendering View[/serviceConfiguration.xhtml]
      javax.el.MethodNotFoundException: class za.co.csir.meraka.mobi4d.console.admin.session.ValueChangedBean_$$_javassist_seam_2.valueChanges has 1 params
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:294)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
           at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at org.jboss.seam.jsf.UnifiedELValueBinding.getValue(UnifiedELValueBinding.java:46)
           at org.ajax4jsf.taglib.html.facelets.KeepAliveHandler.apply(KeepAliveHandler.java:76)
           at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
           at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
           at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
           at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
           at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
           at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
           at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
           at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
           at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
           at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
           at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
           at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
           at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
           at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
           at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
           at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
           at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
           at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
           at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
           at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)


      Can somebody please, tell me what I am doing wrong? Thank you for your help
        • 1. Re: MethodNotFoundException
          Tamas Malatinszki Newbie

          Hi Sammy,


          Try this one


          valueChangeListener="#{valueChangeManager.valueChanges}"



          instead


          valueChangeListener="#{valueChangeManager.valueChanges()}"



          Regards,


          Tamas

          • 2. Re: MethodNotFoundException
            Olalekan Ogunleye Newbie

            Thanks Tamas for the response. However, I got the same error using your suggestion. Any help?

            • 3. Re: MethodNotFoundException
              Tamas Malatinszki Newbie

              Sorry, I just realized that this issue is possibly related to a4j:keepAlive:


              ...
              at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
              at org.jboss.seam.jsf.UnifiedELValueBinding.getValue(UnifiedELValueBinding.java:46)
              at org.ajax4jsf.taglib.html.facelets.KeepAliveHandler.apply(KeepAliveHandler.java:76)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              ...



              Could You check what happens if You remove this line from the xhtlm code?


              <a4j:keepAlive beanName="valueChangeManager.valueChanges()"></a4j:keepAlive>



              Or modify it like this:


              <a4j:keepAlive beanName="valueChangeManager"/>


              • 4. Re: MethodNotFoundException
                Olalekan Ogunleye Newbie

                This works very well. Thank you.



                Tamas Malatinszki wrote on Jan 12, 2011 07:41:


                Sorry, I just realized that this issue is possibly related to a4j:keepAlive:

                ...
                at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                at org.jboss.seam.jsf.UnifiedELValueBinding.getValue(UnifiedELValueBinding.java:46)
                at org.ajax4jsf.taglib.html.facelets.KeepAliveHandler.apply(KeepAliveHandler.java:76)
                at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                ...



                Could You check what happens if You remove this line from the xhtlm code?

                <a4j:keepAlive beanName="valueChangeManager.valueChanges()"></a4j:keepAlive>



                Or modify it like this:

                <a4j:keepAlive beanName="valueChangeManager"/>





                Click HELP for text formatting instructions. Then edit this text and check the preview.