spring整合時的sqlSessionFactory錯誤!

錯誤提示:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [B:\maven_workspace\seckill\target\classes\mapper\SuccessKilledDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Mapper's namespace cannot be empty

 

原因:沒有在SuccessKilledDao.xml中標註namespace

 

解決方法:

添加上namespace

<mapper namespace="org.seckill.dao.SuccessKilledDao">

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章