Thursday 11 July 2013

SOA 11.1.1.6 mybatis with SOA Composites

SOA 11.1.1.6 supports spring framework 2.5.6 , while , mybatis-spring requires spring 3.0.0 or higher.
Hence , it would not be possible to use mybatis within SOA composites.

Even if we include spring-beans-3.1.0 libraries with the composite (under SCA-INF/lib)
we would encounter exception MalformedParameterizedTypeException during
deployment because  the fabric engine would only have access to the spring library from the classpath
[spring library used by fabric
  : MW_HOME/common/modules/org.springframework_2.5.jar]


mybatis source files are all compiled using spring 3.0 libraries.
The mybatis class SqlSessionFactoryBean implements a parametrized
FactoryBean<SqlSessionFactory> which is only available in spring-beans 3.0
and not 2.5.6.

So when the fabric engine tries to create a bean for SqlSessionFactoryBean
using spring 2.5.6 libraries , it fails with
MalformedParameterizedTypeException .


CODE SNIPPETS:
---------------
mybatis  :
org.mybatis.spring.SqlSessionFactoryBean implements
FactoryBean<SqlSessionFactory>

spring 3.0 :
org.springframework.beans.factory.public interface FactoryBean<T>

spring 2.5.6 :
org.springframework.beans.factory.public interface FactoryBean

Since mybatis is not compatible with spring 2.5.6 and SOA does not support
spring 3.0 as yet , we cannot use mybatis  with SOA. I've confirmed that SOA
11.1.1.6 does not support spring 3.0 from both the product management and
spring development team.

No comments:

Post a Comment