Duplicate scanning of MapperFactoryBean

427 views
Skip to first unread message

Brassy Panache

unread,
Sep 16, 2013, 2:41:33 AM9/16/13
to mybati...@googlegroups.com
When using a @MapperScan I receive the warning:

15:32:22.435 [MainThread] WARN   o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'configurationMapper' and 'com.imc.naiad.subscriber.dao.ConfigurationMapper' mapperInterface. Bean already defined with the same name!
15:32:22.444 [MainThread] WARN   o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.imc.naiad.subscriber.dao]' package. Please check your configuration.

I tracked this down to a Spring issue.  When an annotation uses an @Import (as @MapperScan does) Spring will scan the @Import class twice.  I've filed a Spring bug here: https://jira.springsource.org/browse/SPR-10918.  In the interim we could remove the @Import annotation from @MapperScan and let the client add the import themselves.  This is how I've worked around the error message locally.

Eduardo Macarron

unread,
Sep 16, 2013, 4:13:15 PM9/16/13
to mybati...@googlegroups.com
AFAIK this is solved in Spring 3.2. Which version are you using?


2013/9/16 Brassy Panache <brassy....@gmail.com>

--
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 mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages