org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybati-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource com/xy/dao/BookMapper.xml
这个错误提示是sqlSessionFactory sql配置出错,所以调用init失败,因为找不到 com/xy/dao/BookMapper.xml 这个文件。你可以检查一下你连接数据库的代码有没有问题。
Could not find resource com/xy/dao/BookMapper.xml