idea Could not autowire. No beans of type found
今天在学习spring boot的似乎还遇到这个,不知道哪里出错了,希望各位大神指教,谢谢
Could not autowire. No beans of 'AppMessageMapper' type found. less... (Ctrl+F1)
Checks autowiring problems in a bean class.
***************************************************************************************
java.lang.NullPointerException: null
at com.example.mybatis.test.APPMessageController.getAllMessage(APPMessageController.java:30) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE]
*************************************************************************
@Component
public class AppMessageService implements IAppMessageService {
@Autowired
private AppMessageMapper appMessageMapper;