概述
报错内容:
Unsatisfied dependency expressed through field ‘personDao’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘personDao’ defined in file [C:Usershuanshaoworkspacech7bincomdaoPersonDao.class]: 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 class path resource
[applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/po/IdCard (wrong name: com/po/Idcard)
原因:
可能是变量名这种小错误!!比如看下图:
持久层文件
映射文件
解决办法:
将映射文件resultType值:IdCard改为Idcard
最后
以上就是平淡小熊猫为你收集整理的Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/po/IdCard的全部内容,希望文章能够帮你解决Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/po/IdCard所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复