multiple packages in context:component-scan, spring config
The following approach is correct:
<context:component-scan base-package="x.y.z.service, x.y.z.controller" />
Note that the error complains about x.y.z.dao.daoservice.LoginDAO
, which is not in the packages mentioned above, perhaps you forgot to add it:
<context:component-scan base-package="x.y.z.service, x.y.z.controller, x.y.z.dao" />
Annotation Approach
@ComponentScan({ "x.y.z", "x.y.z.dao" })
You can add multiple base packages (see axtavt's answer), but you can also filter what's scanned inside the base package:
<context:component-scan base-package="x.y.z">
<context:include-filter type="regex" expression="(service|controller)\..*"/>
</context:component-scan>