PDA

View Full Version : problem using scope="session"


alexLeung
May 22nd, 2007, 09:19 PM
Hi,

When I start my web app, the following error message appears and my app won't start.

Nested Exception is org.springframework.webflow.engine.ActionExecution Exception: Exception thrown executing [AnnotatedAction@52747818 targetAction = au.com.westpac.ssii.domain.mortgage.web.spring.act ion.ApplicationCaptureAction@73813829, attributes = map['method' -> 'retrieveRBData']] in state 'vs_loadRBData' of flow 'application-capture-flow' -- action execution attributes were 'map['method' -> 'retrieveRBData']'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.applicationProcess_ref': Scope 'session' is not active; nested exception is java.lang.IllegalStateException: No thread-bound request: use RequestContextFilter
Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'scopedTarget.applicationProcess_ref': Scope 'session' is not active; nested exception is java.lang.IllegalStateException: No thread-bound request: use RequestContextFilter
Caused by: java.lang.IllegalStateException: No thread-bound request: use RequestContextFilter
at org.springframework.web.context.request.RequestCon textHolder.currentRequestAttributes(RequestContext Holder.java:61)
at org.springframework.web.context.request.SessionSco pe.get(SessionScope.java:80)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:279)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.aop.target.AbstractPrototypeBa sedTargetSource.newPrototypeInstance(AbstractProto typeBasedTargetSource.java:58)
at org.springframework.aop.target.PrototypeTargetSour ce.getTarget(PrototypeTargetSource.java:30)
at org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.getTarget(Cglib2AopProxy. java:678)
at org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.intercept(Cglib2AopProxy. java:629)
at au.com.westpac.ssii.domain.mortgage.web.spring.fra mework.Menu$$EnhancerByCGLIB$$72a68c1b.getMenuByID (<generated>)
at au.com.westpac.ssii.domain.mortgage.web.spring.hel per.MenuUtil.addLoanSubMenuItem(MenuUtil.java:29)
at au.com.westpac.ssii.domain.mortgage.web.spring.hel per.MigrateRBDataToFormBean.mapLoanToFormFields(Mi grateRBDataToFormBean.java:316)
at au.com.westpac.ssii.domain.mortgage.web.spring.hel per.MigrateRBDataToFormBean.mapOpportunityToFormFi elds(MigrateRBDataToFormBean.java:73)
at au.com.westpac.ssii.domain.mortgage.web.spring.act ion.ApplicationCaptureAction.retrieveRBData(Applic ationCaptureAction.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.springframework.webflow.util.DispatchMethodInv oker.invoke(DispatchMethodInvoker.java:105)
at org.springframework.webflow.action.MultiAction.doE xecute(MultiAction.java:136)
at org.springframework.webflow.action.AbstractAction. execute(AbstractAction.java:203)
at org.springframework.webflow.engine.AnnotatedAction .execute(AnnotatedAction.java:142)
at org.springframework.webflow.engine.ActionExecutor. execute(ActionExecutor.java:61)

I have added the Request Context Filter and listener in my web.xml. See below

<filter>
<filter-name>Request Context Filter</filter-name>
<filter-class>org.springframework.web.filter.RequestContextFilte r</filter-class>
</filter>

<filter-mapping>
<filter-name>Request Context Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
<listener-class>
org.springframework.web.context.request.RequestCon textListener
</listener-class>
</listener>

Could anyone tell me what is wrong?


Best regards.

Jörg Heinicke
May 23rd, 2007, 10:03 AM
That's because you are accessing the proxy on application start up. It fails loading the actual session-scoped bean since you are out of any session context.

Jörg