org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘stockInfoController’: Unsatisfied dependency expressed through field ‘stockInfoService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.obtk.service.StockInfoService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
出现这种情况,看自己的service层上是否有@service注解,将service自动注入
如果不是使用注解的话,就看xml配置文件中是否有service的bean注入