AnnotationTypeMismatchException (SOLVED)

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

AnnotationTypeMismatchException (SOLVED)


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(
    at sun.reflect.annotation.AnnotationInvocationHandler.invoke(
    at com.sun.proxy.$Proxy11.value(Unknown Source)
    at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parseStatement(
    at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(
    at org.apache.ibatis.binding.MapperRegistry.addMapper(
    at org.apache.ibatis.binding.MapperRegistry.addMappers(
    at org.apache.ibatis.binding.MapperRegistry.addMappers(
    at org.apache.ibatis.session.Configuration.addMappers(
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(
    ... 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