启动maven项目出现org.springframework.beans.factory.NoSuchBeanDefinitionException异常

在启动maven项目时,控制台出现了org.springframework.beans.factory.NoSuchBeanDefinitionException异常

严重: StandardWrapper.Throwable
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysRoleController': Unsatisfied dependency expressed through field 'sysRoleService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jt.sys.service.SysRoleService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

导致这个异常的原因是因为spring中找不到相应的bean类

只需要在SysRoleService的子类SysRoleServiceImpl实现类添加@Service注解即可.

你可能感兴趣的:(技术,程序员)