我是靠谱客的博主 平淡小熊猫,这篇文章主要介绍Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/po/IdCard,现在分享给大家,希望可以做个参考。

报错内容:

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(131)

评论列表共有 0 条评论

立即
投稿
返回
顶部