mybitis: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory';

警告: Bean creation exception on non-lazy FactoryBean type check: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserMapper' 
defined in URL [file:/D:/iflytekStudy/myproject/target/classes/spring-mvc.xml]: Cannot resolve reference to 
bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'sqlSessionFactory' defined in URL [file:/D:/iflytekStudy/myproject/target/classes/spring-mvc.xml]: Invocation of 
init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping 
resource: 'file [D:\iflytekStudy\myproject\target\classes\mapper\UserMapper.xml]'; nested exception is 
org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: 
org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: 
org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.iflytek.cms.pojo.User'.  Cause: 
java.lang.ClassNotFoundException: Cannot find class: com.iflytek.cms.pojo.User

Paste_Image.png

**
用generator時出現的錯誤:這個錯誤的地方不在mybatis配置文件,在mapper.xml中:
**

Paste_Image.png
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 1. 簡介 1.1 什么是 MyBatis ? MyBatis 是支持定制化 SQL、存儲過程以及高級映射的優(yōu)秀的...
    笨鳥慢飛閱讀 5,597評論 0 4
  • 前言 本篇將完成DAO層的設計與開發(fā),包括: 數據庫、DAO實體與接口設計與編碼 基于MyBatis實現DAO編程...
    MOVE1925閱讀 1,383評論 0 4
  • Spring 技術筆記Day 1 預熱知識一、 基本術語Blob類型,二進制對象Object Graph:對象圖...
    OchardBird閱讀 997評論 0 2
  • 城市里堅硬的建筑高聳,變暗的讓人感到寒冷的色調到處渲染,人群孤獨的走著,地鐵似帶甲的生物安靜的行駛,天際遙遠,高空...
    阿西達娃閱讀 416評論 0 4
  • 什么是成長,所謂的成長就是你看待事物的角度更加全面,漸漸的不再意氣用事,你會反省自己以前做的事情,會重新看待這些...
    木諾閱讀 243評論 0 0