这个问题出现的很奇怪,基本就如题目所说,编译可以通过,但是在运行时找不到刚写的service接口
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caseActionController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.hibeauty.webbusiness.service.IWebCaseStatusChangeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}
一开始我一直认为是环境问题导致,但是不论是eclipse,还是idea都会报错,这就说明应该是代码问题,最后的原因也发现了,比较shit,我在写接口的的实现类时,忘了加Service的注解,导致前端action在引用的时候,通过Resource标签找不到
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'caseActionController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.hibeauty.webbusiness.service.IWebCaseStatusChangeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}
一开始我一直认为是环境问题导致,但是不论是eclipse,还是idea都会报错,这就说明应该是代码问题,最后的原因也发现了,比较shit,我在写接口的的实现类时,忘了加Service的注解,导致前端action在引用的时候,通过Resource标签找不到