近期在開發項目時用到了spring mvc 和mybatis時運作出現如下錯誤:
org.springframework.beans.factory.beancreationexception: error creating bean with name 'sqlsessionfactory' defined in class path resource [config/spring-database.xml]: initialization of bean failed; nested exception is java.lang.reflect.malformedparameterizedtypeexception
網上搜了一圈都說是springmvc和mybatis的版本沖突,改過之後,還是一樣。
今天突然想到了調試一下他們的源碼
新到斷點到 malformedparameterizedtypeexception 中
運作後發現具體的錯誤是 org.apache,ibatis的問題,查了一下,ibatis早改為mybatis了,然後去掉這個引用就正常了。
其它解決問題的辦法在于找到真正的 問題所在。光看表面的提示其是查不出問題的