Caused by: java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments...
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:284)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults...
Spring 的反射工具 CachedIntrospectionResults 在解析泛型類型(如 Mapper<T>)時,遇到 MalformedParameterizedTypeException,通常是因為 Spring 版本與 MyBatis-Spring 版本不兼容,導致泛型簽名解析失敗。
dependency:tree 確認無重複/衝突 jar。<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.25.RELEASE</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.2</version>
</dependency>
spring-core、spring-beans 混雜。