https://stackoverflow.com/questions/4333390/service-are-constructed-twice
You're doing two separate component-scans over the same base-package. Remove one of them.
Make the following changes
Make the following changes
myapp-config.xml
<!-- Load everything except @Controllers --> <context:component-scan base-package="com.myapp"> <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan>
myapp-servlet.xml
<!-- Load @Controllers only --> <context:component-scan base-package="com.myapp" use-default-filters="false"> <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan>
No comments:
Post a Comment