关于Spring mvc service不能注入的问题 20
配置文件:在使用的时候也有注解在服务器启动时报错:org.springframework.beans.factory.BeanCreationException:Erro...
配置文件:
在使用的时候也有注解
在服务器启动时报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CommentController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private CommentService CommentController.commentService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [CommentService] 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)} 展开
在使用的时候也有注解
在服务器启动时报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CommentController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private CommentService CommentController.commentService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [CommentService] 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)} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询