I’m declaring the <context:component-scan base-package="com.blah.domain.*" /> to scan for all the annotations in spring. i have declared my class under the same package
package com.blah.domain;
@Service
public class UserService extends BaseService implements InitializingBean {
.....
}
The BaseService definition is as follow:-
@Service
public class BaseService {
........
}
I tried invoking the UserService through the web application as well as test case, but in both the cases, the exception is as follows
org.springframework.beans.factory.BeanCreationException: Could not autowire field:private com.blah.domain.service.UserService
I’m pasting the spring definition below:
<task:annotation-driven />
<context:annotation-config/>
<context:component-scan base-package="com.blah.domain.service.*" />
The
base-packageattribute takes a package name, not a wildcard, i.e. it should be