When mapper annotated with @CacheNamespaceRef is parsed before the one where the refered cache is defined, an unreasonable IllegalArgumentException is throw.I debuged and found that this is because when parse the mapper with unresolvedCacheRef,the method is add to incompleteMethods to resolve it later, but the default resultMap is already added to Configuration.resultMaps by MapperAnnotationBuilder.applyResultMap,when resolve the incompleteMethod later, it try to add the same resultMap,this causes IllegalArgumentException. I think this maybe a bug and create this unit test to reproduce it.