3

I tried mybatis-spring 1.2.2 with mybatis 3.2.5 and Spring version 4.1.0.Release and it appears like it is not supported.

mybatis-spring 1.2.2 spring contains org.springframework.core.MethodParameter class however, getContainingClass() is not present.

I am getting the exception: java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()

Any idea is I could use Mybatis with Spring 4x at all? (even ibatis seems to be unsupported)

Andrei Stefan
  • 51,654
  • 6
  • 98
  • 89
user3101143
  • 137
  • 1
  • 3
  • 10

2 Answers2

2

Looking in the pom.xml of the Spring MyBatis here I can see that the project itself depends on Spring 3.2.9:

...
<spring.version>3.2.9.RELEASE</spring.version>
...
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-context</artifactId>
  <version>${spring.version}</version>
  <scope>provided</scope>
</dependency>

So, based on that I wouldn't be surprised if I would get an exception like the one you are getting in my project and I would have to say that "no", it's not supported.

Andrei Stefan
  • 51,654
  • 6
  • 98
  • 89
  • 1
    The fact the ibatis/mybatis is not included in spring orm 4.0.6 release (http://mvnrepository.com/artifact/org.springframework/spring-orm/4.0.6.RELEASE) implied that they are not yet supported in spring 4.x ..... it does include hibernate, jdo and jpa though. – user3101143 Aug 01 '14 at 16:07
  • Spring ORM never supported MyBatis 3 in the first place. MyBatis Spring, which is the library that the question is referring to, is a different library made by the MyBatis team. – andrerobot May 06 '15 at 20:30
0

We are using MyBatis v3.2.7 with Spring v4.0.6 and so far we have not seen any issues. Since Spring usually maintains the backward compatibility, it usually works.

However, I am not sure (as of this writing) if it is totally supported in Spring v4.1.x.

Uresh K
  • 1,136
  • 11
  • 16