java的ssm项目采坑,ssm项目设计了多个maven模块包含domain、dao、service、web等四个模块
maven项目启动的时候就报错
Error creating bean with name 'StudentInfoController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean 'com.cloud.xp.manager.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
意思是创建“StudentInfoController”bean对象失败,开始以为没有加注解或者是加的注解错误
根据图可以看到,@Controller注解加的并没有错误
经过两天的csdn采坑,终于自己灵机一动 ,发现dao、service模块打包的方式是war包,都修改为jar包的方式结果能正常访问了。