Error creating bean with name 'userController'

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService';
 nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
 No qualifying bean of type 'com.boron.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. 
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

The reason: service layer does not add comment
When the ride spring mvc framework, ide compile error does not complain but there will be a few considerations:
1.controller annotated
@Controller instead @RestController
@RequestMapping("/user")

2.service annotated

@Service
@Autowired
3.dao annotated and implement interfaces
@Param("")

Guess you like

Origin blog.csdn.net/Pei_hua100/article/details/90636284