AnnotationTypeMismatchException (SOLVED)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

AnnotationTypeMismatchException (SOLVED)

zachv
Hi

I already found the answer to my problem, I am just posting it here for posterity.

I had a library that was compiled with mybatis 3.2.2 and a web project using it that was compiled with 3.4.4. At runtime I would get the below exception because the @ResultMap annotation had changed value from a String to String[]. Changing the library to be compiled with the same version made it go away.

Caused by: java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract java.lang.String[] org.apache.ibatis.annotations.ResultMap.value() (Found data of type class java.lang.String[xx.xx.xx.xxxxxx.mybatis.generated.mapper.XXXMapper.BaseResultMap])
    at sun.reflect.annotation.AnnotationTypeMismatchExceptionProxy.generateException(AnnotationTypeMismatchExceptionProxy.java:57)
    at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:75)
    at com.sun.proxy.$Proxy11.value(Unknown Source)
    at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parseStatement(MapperAnnotationBuilder.java:338)
    at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:134)
    at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:72)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:97)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:105)
    at org.apache.ibatis.session.Configuration.addMappers(Configuration.java:724)
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:360)
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:118)
    ... 30 more

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.