Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Waiting for Triage
-
Component/s: [Documentation]
-
Labels:None
-
Last commented by a User:true
Description
Since the introduction of <context:component-scan /> I answer more and more question on issues regarding transactions and proxying in general. Mostly due to the fact that tx:annotation-driven is configured in the root ApplicationContext and that context:component-scan is defined in both the root as well as the servlet ApplicationContext. This results in 2 instances of a @Service/@Repository being available.
A hint/example in the web chapter of the reference guide would help here on how to configure the context:component-scan in such a case.
1. only scan @Controller in the servlet and everything but @Controller in the root.
2. Configure mvc to look for @Controller in the root context, leaving the servlet context almost clean.
either way should work, although I guess that option 1 is the preffered way.