Description:
Field businessLogRecordDao in com.etc.service.impl.BusinessLogRecordServiceImpl required a bean of type 'com.etc.mapper.BusinessLogRecordMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.etc.mapper.BusinessLogRecordMapper' in your configuration.
==============================================================================
public interface BusinessLogRecordMapper extends MongoRepository<BusinessLogRecord,String> { }
解决方法,注解添加mapper所在目录,@EnableMongoRepositories(basePackages = {"com.etc.mapper"})
@SpringBootApplication
@EnableCaching
@ComponentScan(basePackages = {"com.etc.*","com.example.*"})
@EnableMongoRepositories(basePackages = {"com.etc.mapper"})
public class WebsiteApplication {
public static void main(String[] args) {
SpringApplication.run(WebsiteApplication.class, args);
}
}