Caused by: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate result class. Cause: java.lang.InstantiationException: java.util.Map
原因:
ibatis查询出错。ibatis中Map作为resultClass时,必须指定具体的实现类,比如java.util.HashMap,否则会报错
解决方法:
把
select * from Special_Item
where AnswerId = AnswerIdAnswerIdAnswerId and SepcialId = SepcialIdSepcialIdSepcialId
改成
select * from Special_Item
where AnswerId = AnswerIdAnswerIdAnswerId and SepcialId = SepcialIdSepcialIdSepcialId
本文详细解析了ibatis框架中使用Map作为resultClass时出现的java.lang.InstantiationException错误原因及解决方案。当未指定具体Map实现类时,如java.util.HashMap,ibatis将无法实例化结果,导致运行时异常。
6429

被折叠的 条评论
为什么被折叠?



