google-code-export / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Fail to create XMLMyBatisModule in 3.2.1 (3.2.0) version #800

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After switching from version 3.1.1 to 3.2.1 (3.2.0) the creation of 
XMLMyBatisModule failed with following description:
Impossible to read classpath resource 'MapperConfig.xml', see nested 
exceptions: java.util.HashMap cannot be cast to java.util.Set

After debugging I observed the error is reported in class 
org.mybatis.guice.XMLMyBatisModule in the following line:
// bind mappers
@SuppressWarnings("unchecked")
Set<Class<?>> mapperClasses = (Set<Class<?>>) getValue(KNOWN_MAPPERS, context, 
configuration);

Probably because the type of the variable knownMappers from class 
org.apache.ibatis.binding.MapperRegistry was changed in new release.

I' using Guice version 3.0 and mybatis-guice 3.3.

Original issue reported on code.google.com by tomwi...@gmail.com on 24 Mar 2013 at 12:09

GoogleCodeExporter commented 9 years ago
It is already fixed in the master branch of guice (in Github)

Original comment by eduardo.macarron on 25 Mar 2013 at 10:49

GoogleCodeExporter commented 9 years ago
I have the same issue with version 3.2.2, the creation of XMLMyBatisModule 
failed with following description:
Impossible to read classpath resource 'MapperConfig.xml', see nested 
exceptions: java.util.HashMap cannot be cast to java.util.Set

After debugging I observed the error is reported in class 
org.mybatis.guice.XMLMyBatisModule in the following line:
// bind mappers
@SuppressWarnings("unchecked")
Set<Class<?>> mapperClasses = (Set<Class<?>>) getValue(KNOWN_MAPPERS, context, 
configuration);

Probably because the type of the variable knownMappers from class 
org.apache.ibatis.binding.MapperRegistry was changed in new release.

I' using Guice version 3.0 and mybatis-guice 3.3.

Original comment by qiang...@gmail.com on 10 Aug 2013 at 7:05