Results 1 to 7 of 7

Thread: NoSuchMethodException in webFlow

  1. #1
    Join Date
    Aug 2005
    Posts
    13

    Default NoSuchMethodException in webFlow

    hey there i have a problem here when i try making an application using spring webflow (simple app.)
    the error i get is :

    state 'ProcessRequest' of flow 'myFlow'; nested exception is org.springframework.webflow.util.DispatchMethodInv oker$MethodLookupException: Unable to resolve action method with name 'ProcessRequest' and signature 'public org.springframework.webflow.Event ProcessRequest(interface org.springframework.webflow.RequestContext);'; make sure the method name is correct and such a public method is defined on targetClass com._4s_.banks.web.action.MyFlowAction; nested exception is java.lang.NoSuchMethodException: com._4s_.banks.web.action.MyFlowAction.ProcessRequ est(org.springframework.webflow.RequestContext)


    my code is here:

    webFlow.xml
    --------------------

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE webflow PUBLIC "-//SPRING//DTD WEBFLOW//EN"
    "http://www.springframework.org/dtd/spring-webflow.dtd">

    <webflow id="myFlow" start-state="displayForm">

    <view-state id="displayForm" view="form2">
    <entry>
    <action bean="myFlowAction" method="setupForm" />
    </entry>
    <transition on="submit" to="ProcessRequest">
    <action bean="myFlowAction" method="bindAndValidate" />
    </transition>
    </view-state>

    <action-state id="ProcessRequest">
    <action bean="myFlowAction" />
    <transition on="success" to="finish" />
    </action-state>

    <end-state id="finish" view="form" />

    </webflow>




    Action Code is :
    ---------------------

    public class MyFlowAction extends FormAction {
    public MyFlowAction() {
    setFormObjectName("bank");
    setFormObjectClass(Bank.class);
    }

    public Event ProcessRequest(RequestContext context) throws Exception {

    return success();
    }
    }



    and my servlet looks like this :
    -------------------------------------------



    <bean id="myFlow"
    class="org.springframework.webflow.config.XmlFlowF actoryBean">
    <property name="location" value="/WEB-INF/myFlow.xml" />
    </bean>

    <bean id="myFlowAction"
    class="com._4s_.banks.web.action.MyFlowAction" />



    <bean name="myApp"
    class="org.springframework.webflow.mvc.FlowControl ler" />


    so y do i keep getting this error??? knowing that i use the same myflow.xml with some modifications to use "ERVACON" jars insted of spring webflow pure jars

    thanks alot for your time

  2. #2
    Join Date
    Nov 2005
    Posts
    17

    Default

    Hi 4s,

    I'm still a newb but I think your issue is in the flow declaration:

    Code:
    <action-state id="ProcessRequest">
    <action bean="myFlowAction" />
    <transition on="success" to="finish" />
    </action-state>
    Since you define an action bean but don't specify a method name SWF tries to call "Event myFlowAction.ProcessRequest(RequestContext context)" when it reaches that action. My guess is myFlowAction doesn't contain a method with the signature above, and that is producing the error.

    -P

  3. #3
    Join Date
    Nov 2005
    Posts
    17

    Default

    Doh - I guess I didn't fully read your description - well, is the capitalization on the method name correct ProcessRequest as opposed to processRequest

  4. #4
    Join Date
    Aug 2005
    Posts
    13

    Default

    thanks padukes for replying but it is not about name as i changed it and it gave me the same error do u have any other idea ?

    thanks alot for your time

  5. #5
    Join Date
    Aug 2005
    Posts
    13

    Default

    well i found the error :S thanks alot for your help

  6. #6
    Join Date
    Nov 2005
    Posts
    17

    Default

    So what was the error?

  7. #7
    Join Date
    Aug 2005
    Posts
    13

    Default

    well i was imporing a wrong library thats why the error kept telling:unable to resolve action method with name 'ProcessRequest' and signature 'public org.springframework.webflow.Event ProcessRequest(interface org.springframework.webflow.RequestContext)

    thanks alot for your time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •