-
Jul 5th, 2009, 10:29 AM
#1
<on-start> service not called
Hi,
everying works except that the <on-start> service is not called...googled but seems that nobody had similar problem so far.
What I am using:
Spring 2.5.6, Web Flow 2.0.7, Eclipse Web Platform with built-in Tomcat 6.0
Appreciate if you have any advice !
thanks in advance!!
My Service:
-----------
@Service
public class ProductFamilyService implements FactoryBean, InitializingBean, DisposableBean, ApplicationContextAware {
public List<ProductFamily> getAllProductFamilies () {
logger.debug ("if called");
return this.families.getFamilies();
}
}
My flow
-------
<on-start>
<evaluate expression="productFamilyService.getAllProductFami lies()" result="flowScope.families"/>
</on-start>
<!-- By default, the first state is the start state. -->
<view-state id="product" view="productFlow">
<transition on="addOptionGroup" to="addOptionGroup" />
<transition on="addProduct" to="addProduct"/>
</view-state>
.....
My Flow/application context config
--------------------------------
<!-- Enables annotated methods on POJO @Controllers -->
<bean class="org.springframework.web.servlet.mvc.annotat ion.AnnotationMethodHandlerAdapter"/>
<!-- Enables POJO @Controllers -->
<bean class="org.springframework.web.servlet.mvc.annotat ion.DefaultAnnotationHandlerMapping"/>
<!-- Enables plain Controllers (e.g. FlowController) -->
<bean class="org.springframework.web.servlet.mvc.SimpleC ontrollerHandlerAdapter"/>
<!-- Map the name used in ModelAndView to the page -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlVi ew"></property>
<property name="prefix">
<value>/WEB-INF/page/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<!-- Web Flow -->
<webflow:flow-executor id="flowExecutor"/>
<!-- The registry of executable flow definitions -->
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path="/WEB-INF/flow/productFlow.xml" id="productFlow"/>
</webflow:flow-registry>
<!-- Plugs in a custom creator for Web Flow views -->
<webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/>
<!-- Configures Web Flow to use freemarker to create views for rendering -->
<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.Mvc ViewFactoryCreator">
<property name="viewResolvers" ref="viewResolver"/>
</bean>
<bean id="viewMappings" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="mappings">
<value>
/productFlow.htm=flowController
</value>
</property>
<property name="defaultHandler">
<bean class="org.springframework.web.servlet.mvc.UrlFile nameViewController" />
</property>
</bean>
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.Flo wController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<!-- Services -->
<bean id="productFamilyService" class="net.canal.spc.service.ProductFamilyService"/>
~~~~~~~~~~~~~~~
Here is the log message
~~~~~~~~~~~~~~~
23:28:12,781 DEBUG FlowExecutorImpl:135 - Launching new execution of flow 'productFlow' with input null
23:28:12,781 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'productFlow'
23:28:12,781 DEBUG FlowExecutionImplFactory:78 - Creating new execution of 'productFlow'
23:28:12,781 DEBUG FlowExecutionImpl:215 - Starting in org.springframework.webflow.mvc.servlet.MvcExterna lContext@a8a81c with input null
23:28:12,781 DEBUG ActionExecutor:49 - Executing [EvaluateAction@11f139b expression = marketService.getAllMarketSegments(), resultExposer = [ActionResultExposer@1402eeb result = flowScope.markets, resultType = [null]]]
23:28:12,781 DEBUG AnnotatedAction:142 - Putting action execution attributes map[[empty]]
23:28:12,781 DEBUG AnnotatedAction:149 - Clearing action execution attributes map[[empty]]
23:28:12,781 DEBUG ActionExecutor:53 - Finished executing [EvaluateAction@11f139b expression = marketService.getAllMarketSegments(), resultExposer = [ActionResultExposer@1402eeb result = flowScope.markets, resultType = [null]]]; result = success
23:28:12,796 DEBUG ActionExecutor:49 - Executing [EvaluateAction@1275a34 expression = productFamilyService.getAllProductFamilies(), resultExposer = [ActionResultExposer@9319d9 result = flowScope.families, resultType = [null]]]
23:28:12,796 DEBUG AnnotatedAction:142 - Putting action execution attributes map[[empty]]
23:28:12,796 DEBUG AnnotatedAction:149 - Clearing action execution attributes map[[empty]]
23:28:12,796 DEBUG ActionExecutor:53 - Finished executing [EvaluateAction@1275a34 expression = productFamilyService.getAllProductFamilies(), resultExposer = [ActionResultExposer@9319d9 result = flowScope.families, resultType = [null]]]; result = success
23:28:12,796 DEBUG ViewState:189 - Entering state 'product' of flow 'productFlow'
23:28:12,796 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'name' with value productFlow
23:28:12,796 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'caption' with value null
23:28:12,796 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'description' with value null
23:28:12,796 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'flowExecutionSnapshotGroup' with value org.springframework.webflow.execution.repository.i mpl.SimpleFlowExecutionSnapshotGroup@17f1d92
23:28:12,796 DEBUG FlowExecutionImpl:417 - Assigned key e2s1
23:28:12,796 DEBUG DefaultFlowExecutionRepository:118 - Putting flow execution '[FlowExecutionImpl@6e8504 flow = 'productFlow', flowSessions = list[[FlowSessionImpl@1dedb45 flow = 'productFlow', state = 'product', scope = map['markets' -> [null], 'families' -> [null], 'viewScope' -> map[[empty]]]]]]' into repository
23:28:12,796 DEBUG DefaultFlowExecutionRepository:125 - Adding snapshot to group with id 1
23:28:12,812 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[null] -> list[[empty]]]]]
23:28:12,812 DEBUG FlowHandlerAdapter:367 - Sending flow execution redirect to '/spc/productFlow.htm?execution=e2s1'
23:28:12,812 DEBUG FlowExecutorImpl:155 - Resuming flow execution with key 'e2s1
23:28:12,812 DEBUG SessionBindingConversationManager:67 - Locking conversation 2
23:28:12,812 DEBUG DefaultFlowExecutionRepository:103 - Getting flow execution with key 'e2s1'
23:28:12,812 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'productFlow'
23:28:12,812 DEBUG FlowExecutionImpl:250 - Resuming in org.springframework.webflow.mvc.servlet.MvcExterna lContext@18837f1
23:28:12,812 DEBUG ViewState:275 - Rendering + [ServletMvcView@10f0a0 view = org.springframework.web.servlet.view.JstlView: name 'productFlow'; URL [/WEB-INF/page/productFlow.jsp]]
23:28:12,812 DEBUG ViewState:276 - Flash scope = map[[empty]]
23:28:12,828 DEBUG ViewState:277 - Messages = [DefaultMessageContext@db95a1 sourceMessages = map[[null] -> list[[empty]]]]
23:28:12,828 DEBUG AbstractMvcView:177 - Rendering MVC [org.springframework.web.servlet.view.JstlView: name 'productFlow'; URL [/WEB-INF/page/productFlow.jsp]] with model map [{flowRequestContext=[RequestControlContextImpl@3c9616 externalContext = org.springframework.webflow.mvc.servlet.MvcExterna lContext@18837f1, currentEvent = [null], requestScope = map[[empty]], attributes = map[[empty]], messageContext = [DefaultMessageContext@db95a1 sourceMessages = map[[null] -> list[[empty]]]], flowExecution = [FlowExecutionImpl@1a18ee2 flow = 'productFlow', flowSessions = list[[FlowSessionImpl@1abcd9b flow = 'productFlow', state = 'product', scope = map['markets' -> [null], 'families' -> [null], 'viewScope' -> map[[empty]]]]]]], flashScope=map[[empty]], markets=null, currentUser=org.springframework.security.providers .UsernamePasswordAuthenticationToken@41e22f96: Principal: net.canal.spc.model.UserInView@7b7b11; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.ui.WebAuthenticationD etails@255f8: RemoteIpAddress: 127.0.0.1; SessionId: C0062DD603BFA45E668EEF7B9BC2C58A; Granted Authorities: ROLE_USER, admin, flowExecutionKey=e2s1, families=null, flowExecutionUrl=/spc/productFlow.htm?execution=e2s1, viewScope=map[[empty]]}]
23:28:13,125 DEBUG DefaultFlowExecutionRepository:118 - Putting flow execution '[FlowExecutionImpl@1a18ee2 flow = 'productFlow', flowSessions = list[[FlowSessionImpl@1abcd9b flow = 'productFlow', state = 'product', scope = map['markets' -> [null], 'families' -> [null], 'viewScope' -> map[[empty]]]]]]' into repository
23:28:13,125 DEBUG DefaultFlowExecutionRepository:125 - Adding snapshot to group with id 1
23:28:13,140 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[empty]]]]
23:28:13,140 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 2
-
Jul 6th, 2009, 12:20 AM
#2
tested, POJO service works, but this service won't work:
public class MarketService implements FactoryBean, InitializingBean, DisposableBean, ApplicationContextAware {
...
}
any insight on this issue ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules