java.lang.reflect.MalformedParameterizedTypeException 的解决办法

    xiaoxiao2026-03-01  7

    近期在开发项目时用到了spring mvc 和mybatis时运行出现如下错误:

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring-database.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException

    网上搜了一圈都说是springmvc和mybatis的版本冲突,改过之后,还是一样。

    今天突然想到了调试一下他们的源码

    新到断点到  MalformedParameterizedTypeException 中

    运行后发现具体的错误是 org.apache,ibatis的问题,查了一下,ibatis早改为mybatis了,然后去掉这个引用就正常了。

    其它解决问题的办法在于找到真正的 问题所在。光看表面的提示其是查不出问题的

    最新回复(0)