Description: Field bookMapper in com.feng.mybatis.service.BookService required a bean of type ‘com.

1、错误

Description:

Field bookMapper in com.feng.mybatis.service.BookService required a bean of type 'com.feng.mybatis.mapper.BookMapper' 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.feng.mybatis.mapper.BookMapper' in your configuration.


Process finished with exit code 0

2、原因
忘记在mapper类上添加@Mapper注解了

@Mapper
public interface BookMapper {
    
    
    public Book getBookById(Integer id);
}

猜你喜欢

转载自blog.csdn.net/qq_43987149/article/details/121318346
今日推荐