解决MyBatis中'TypeException: The alias 'TProject' is already mapped'异常
"Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.type.TypeException: The alias 'TProject' is already mapped to the value 'com.bonoon.domain.TProject'." java\u4e2d\u629b\u51fa\u8fd9\u4e2a\u5f02\u5e38\u600e\u4e48\u5904\u7406\u8fd9\u4e2a\u5f02\u5e38\u662f\u7531\u4e8e\u5728MyBatis\u914d\u7f6e\u6587\u4ef6\u4e2d\u91cd\u590d\u5b9a\u4e49\u4e86\u522b\u540d\u2019TProject\u2019\u6240\u5f15\u8d77\u7684\u3002\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u5904\u7406\uff1a\n\n1. \u5f00\u59cbMyBatis\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u5e38\u89c1\u662fmybatis-config.xml\uff09\uff0c\u641c\u7d22\u662f\u5426\u6709\u91cd\u590d\u5b9a\u4e49\u2019TProject\u2019\u7684\u522b\u540d\u3002\n2. \u5982\u679c\u627e\u5230\u4e86\u91cd\u590d\u5b9a\u4e49\u7684\u522b\u540d\uff0c\u5c06\u5176\u4e2d\u7684\u4e00\u4e2a\u5220\u9664\u6216\u8005\u4fee\u6539\u4e3a\u5176\u4ed6\u4e0d\u91cd\u590d\u7684\u522b\u540d\u3002\n3. \u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u65b0\u8fd0\u884c\u7a0b\u5e8f\uff0c\u770b\u662f\u5426\u8fd8\u4f1a\u629b\u51fa\u76f8\u540c\u7684\u5f02\u5e38\u3002\n\n\u5982\u679c\u8fd8\u6709\u5176\u4ed6\u7684\u522b\u540d\u91cd\u590d\u95ee\u9898\uff0c\u4e5f\u53ef\u4ee5\u6309\u7167\u7c7b\u4f3c\u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406\u3002\u8bf7\u786e\u4fdd\u5728\u6574\u4e2aMyBatis\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6bcf\u4e2a\u522b\u540d\u90fd\u662f\u552f\u4e00\u7684\u3002
原文地址: https://www.cveoy.top/t/topic/pF1g 著作权归作者所有。请勿转载和采集!