Announcement Announcement Module
Collapse
No announcement yet.
No flow definition found (SWF 2.0 M3) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No flow definition found (SWF 2.0 M3)

    Hi all,

    I encountered a "No flow definition ... found" problem. I wonder if the flow definition file (in my case, the login-flow.xml) is actually loaded because even though I intentionally added a few XML syntax error (e.g. missing end tag) on it, the app deployed successfully without any XML parsing error.


    Shown below is my config details:

    /WEB-INF/web.xml
    Code:
    <servlet>
    	<servlet-name>springapp</servlet-name>	<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/WEB-INF/config/applicationContext.xml</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>springapp</servlet-name>
    		<url-pattern>/app/*</url-pattern>
    	</servlet-mapping>
    
    	<welcome-file-list>
    		<welcome-file>welcome.jsp</welcome-file>
    	</welcome-file-list>
    </web-app>

    /WEB-INF/config/applicationContext.xml
    Code:
    <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    	<property name="mappings">
    		<value>/**/*=flowController</value>
    	</property>
    </bean>
    
    <bean id="flowController" class="org.springframework.webflow.mvc.FlowController">
    	<property name="flowExecutor" ref="flowExecutor" />
    </bean>
    
    <flow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
    </flow:flow-executor>
    
    <flow:flow-registry id="flowRegistry">
    	<flow:flow-location path="/WEB-INF/flow/login/login-flow.xml" />
    </flow:flow-registry>
    /WEB-INF/flow/login/login-flow.xml
    Code:
    	<attribute name="id" value="login" />
    
    	<start-state idref="enterLoginInformation" />
    
    	<view-state id="enterLoginInformation" view="login">
    	
    	</view-state>
    
    	<end-state id="showHomepage" view="homepage" />
    welcome.jsp
    Code:
    <a href="Javascript:myRef = window.open('app/login.html?_flowId=login','app','scrollbars=yes,left=0,top=0,width=1016,height=700,toolbar=0,menubar=0,resizable=1');myRef.focus();">
    login</a>

    10:32:46,807 ERROR [[springapp]] Servlet.service() for servlet springapp threw exception
    org.springframework.webflow.definition.registry.No SuchFlowDefinitionException:No flow definition 'login.html' found


    Please give my some advices what may go wrong. Thanks a lot.

    Regards,
    Koala Lam

  • #2
    I also found that even though I specified a flow definition file which doesn't exist, the deployment won't fail.

    Code:
    <flow:flow-location path="/WEB-INF/flow/login/login-flow_notExist.xml" />

    Comment


    • #3
      The problem is solved. Cause of it are:

      1) The 'id' attribute in flow definition is not working ie. can't specify flow id
      NO "_flowId" parameter is specified in the URL. Is this parameter no longer used in version 2.0?
      2) Like the sample project, need to specify a Flow Builder Services bean


      The changes include:

      applicationContext.xml
      Code:
      	<flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
      		<flow:flow-location path="/WEB-INF/flow/login/login.xml" />
      	</flow:flow-registry>
      
      	<bean id="flowBuilderServices" class="org.springframework.webflow.engine.builder.support.FlowBuilderServices">
      		<property name="viewFactoryCreator">
      			<bean class="org.springframework.webflow.mvc.MvcViewFactoryCreator"/>
      		</property>
      	</bean>
      
      welcome.jsp
      Code:
      <a href="Javascript:myRef = window.open('app/login','test','scrollbars=yes,left=0,top=0,width=1016,height=700,toolbar=0,menubar=0,resizable=1');myRef.focus();">test</a>

      Comment


      • #4
        Hi,

        I am new to Spring webflow and now I am trying the example in Spring recipes book.

        I am getting the error as follows,
        Code:
        No flow definition '${flowExecutionUrl}&_eventId=next' found
        Shown below is my configurations,

        Code:
        <bean name="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
        		<property name="flowExecutor" ref="flowExecutor"></property>
        	</bean>
        	
        	<webflow:flow-executor id="flowExecutor" />
        	
        	<webflow:flow-registry id="flowRegistry" >
        		<webflow:flow-location path="/WEB-INF/flows/welcome/welcome.xml"></webflow:flow-location>
        	</webflow:flow-registry>
        "/WEB-INF/flows/welcome/welcome.xml,
        Code:
        <view-state id="welcome">
        		<transition on="next" to="introduction" />
        		<transition on="skip" to="menu" />
        	</view-state>
        	
        	<view-state id="introduction">
        		<on-render>
        			<evaluate expression="libraryService.getHolidays()" result="requestScope.holidays" />
        		</on-render>
        		<transition on="next" to="menu" />
        	</view-state>
        	
        	<view-state id="menu"></view-state>
        In welcome.jsp,

        Code:
        <a href="${flowExecutionUrl}&_eventId=next">Next</a>
        	<a href="${flowExecutionUrl}&_eventId=skip">Skip</a>
        Please let me know what is going wrong. I am using 2.0.9 Release.

        Thanks in advance,
        SD

        Comment


        • #5
          No flow defination found

          you can try this,

          <a href="${flowExecutionUrl}&_eventId_next">Next</a>
          <a href="${flowExecutionUrl}&_eventId_skip">Skip</a>

          Comment


          • #6
            Hi,

            My problem was with EL. I need to enable EL in jsp. I used
            Code:
            <%@ page isELIgnored="false" %>
            and everything went fine.

            Thanks,
            SDB

            Comment

            Working...
            X