bug描述:
Exception encountered during context initialization - cancelling refresh attempt: 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 [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘com/fish/dao/BookMapper.xml’. Cause: org.apache.ibatis.builder.BuilderException: Mapper’s namespace cannot be empty
忘记写mapper中的命名空间,导致在运行程序时出现了bug
解决方法:添加mapper的命名空间