Thursday, February 21, 2013

MyBatis-Spring 1.2.0 Released

Dear Community,

MyBatis Team is pleased to announce the release of MyBatis-Spring 1.2.0

See the details of this release in the tracker.

It is available in maven central repository as a jar or a bundle.

New features:
- New @MapperScan annotation.
- New <mybatis> namespace.

Upgrade Notes:
- @Autowired has been removed from SqlSessionDaoSupport (and MapperFactoryBean).
- Dependencies to Spring-Jdbc & MyBatis are now "provided" so you may need to include them explicitly in your pom.xml.

Se the docs for more details.

Thank your all for your contributions and help!


  1. Spring 3.2.1 has been out since January and 3.2.2 is just around the corner. MyBatis-spring uses still 3.1.3.RELEASE, what are your plans for the upgrade?

  2. I try your scan with STS and I get a mybatis-spring namespace, but not mybatis as stated in your documentation on If you use what is in the document, I get the following error: Multiple annotations found at this line:
    - schema_reference.4: Failed to read schema document '', because 1) could not find the document; 2) the
    document could not be read; 3) the root element of the document is not .
    - Unable to locate Spring NamespaceHandler for element 'mybatis:scan' of schema namespace ''

    If I use the namespace show up in STS, I get another error: Error occured processing XML 'loader constraint violation: when resolving field "logger" the class loader (instance of org/springframework/ide/eclipse/core/java/ProjectClassLoaderCache
    $FilteringURLClassLoader) of the referring class, org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider, and the class loader (instance of org/eclipse/osgi/
    internal/baseadaptor/DefaultClassLoader) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type'. See Error Log for more details

    None of them work. :(

  3. @Kari. We compile it against 3.1.3 to ensure that it keeps compatibility with spring 3.1 but it works fine with spring 3.2.

    @TK. Thanks for pointing! The doc sample is wrong, I have just published the fixed site again. Please try again. If the problem persist, please open an issue in Github.