Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Spring
-
Labels:None
-
Environment:XFire 1.2.2
Spring 2.0
Description
When Jsr181HandlerMapping class (in method method processBeans) scans bean factory for beans which have JSR 181 annotations, it grabs live instances of beans from bean factory (calls beanFactory.getBean(...).
This causes problems for Spring 2.0 beans which has 'session' or 'request' scope, because they can be obtained only from context of HTTP request (see attached stack trace).
Is it really necessary to get the live beans from the bean factory?
I have locally patched it in following way
– bean target class name for bean I take from the BeanDefinition object
– the class object is obtained using Class.forName using bean factorie's class loader
– in this case I don't need the live bean instance
such like: clazz = Class.forName(def.getBeanClassName(), false, ctxt.getClassLoader())
But I'm not sure, if it's right.
Jsr181HandlerMapping also tries to create beans marked lazy-init="true"