Could not autowire. No beans of 'TrainBookTypeMapper' type found.
时间: 2023-10-30 14:42:48 浏览: 57
spring-autowire.zip
This error message indicates that there is no bean of type 'TrainBookTypeMapper' available in the Spring application context for autowiring. This could be due to a few reasons:
1. The bean has not been defined in the Spring configuration file.
2. The bean has been defined, but with a different name or type than what is being autowired.
3. The bean has not been instantiated or added to the application context at runtime.
To resolve this issue, check the Spring configuration file to ensure that the bean is defined correctly and has been added to the application context. Also, make sure that the name and type of the bean match what is being autowired. If the bean still cannot be found, try instantiating it manually and adding it to the application context.
阅读全文