报错内容:
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内容请搜索靠谱客的其他文章。
发表评论 取消回复