springmvc通过注解的方式无法实列化类
sdssb 2017-07-26 02:15:41 通过注解的方式向配置文件注入类,启动服务器就报错,但手动注入就不会报错。
报的错误如下:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jgHandler': Unsatisfied dependency expressed through field 'jgService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jgService': Unsatisfied dependency expressed through field 'jgMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jg1.JgMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}