mybatis和spring整合时出现的问题,不能注册别名

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis和spring整合时出现的问题,不能注册别名相关的知识,希望对你有一定的参考价值。

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'typeAliasesPackage' of bean class [org.mybatis.spring.SqlSessionFactoryBean]: Bean property 'typeAliasesPackage' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

参考技术A 这段配置的代码贴下看看呀,mybatis,和spring的版本分别是什么?或者你可以看看你的jar包中SqlSessionFactoryBean类中,是否有ypeAliasesPackage这个属性,还有set方法参数等信息 参考技术B 把别名定义为 如下格式:
比如:private String a;
然后对a进行 setter和getter
然后在运行程序!!本回答被提问者和网友采纳

mybatis学习笔记(14)-spring和mybatis整合

mybatis学习笔记(17)-spring和mybatis整合

标签: mybatis spring