hi
i'm beginning with spring 3.0
i try to use annotation to reduce xml file
i get:
my controler classCode:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supervisionController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.h23v.service.IUserService com.h23v.controller.UserController.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.h23v.service.IUserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Code:@Controller public class UserController { @Autowired private IUserService userService; ... }
my service class
Code:@Service public class UserService implements IUserService { @Autowired private IUserDao userDao; ... }
my dao class
a part of my dispatch servlet fileCode:@Repository public class UserDaoImpl extends JdbcDaoSupport implements IUserDao{ @Override public List<User> getAllUser() { ... } ... }
a part of my application context fileCode:<context:component-scan base-package="com.h23v.controller"/> <context:annotation-config/>
i don't understand the errorCode:<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="/WEB-INF/jdbc.properties" /> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" />
any idea
thanks


Reply With Quote
