Monday, November 23, 2015

spring4gwt(+ mybatis) startup warning:No MyBatis mapper was found in '[]' package

My configuration is:

spring-4.2.3  mybatis-3.3.0  mybatis-spring-1.2.3  mapper looks like:

Mapper looks like:

package;  //imports...  public interface SeniorMapper extends BaseMapper<Long, Senior>  {     @Results({...})     @Select(...)     public List<Senior> query(...);  }

ServiceImpl looks like:

package;  //imports...  @Service("querySenior")  public class SeniorQueryServiceImpl extends RemoteServiceServlet implements     SeniorQueryService  {      @Autowired      SeniorMapper mapper;        @Override      public List<Senior> query(Address address, String careType){...}  }

applicationContext.xml looks like:

<beans ... default-lazy-init="true">     <!-- MyBatis Mapper Interfaces -->     <mybatis:scan base-package="" />       //other configurations  </beans>

Spock unit test looks like below,and runs as expected

@ContextConfiguration(locations = "file:war/WEB-INF/applicationContext.xml")  public class SeniorQueryServiceImplTest extends Specification{      @Autowired    SeniorQueryServiceImpl service      def "query by full address"(){       //here query data succeed in real testing    }  }

But when start web application,I got this warning:

INFO: Root WebApplicationContext: initialization started Nov 23, 2015 7:12:29 PM prepareRefresh  INFO: Refreshing Root WebApplicationContext: startup date [Mon Nov 23 19:12:29 CST 2015]; root of context hierarchy Nov 23, 2015 7:12:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] Nov 23, 2015 7:12:29 PM org.mybatis.spring.mapper.ClassPathMapperScanner doScan  WARNING: No MyBatis mapper was found in '[]' package. Please check your configuration.Nov 23, 2015 7:12:30 PM org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor <init>  INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring  Module setup completed in 1698 ms  Nov 23, 2015 7:12:30 PM org.springframework.web.context.ContextLoader initWebApplicationContext  INFO: Root WebApplicationContext: initialization completed in 1557 ms

I am sure that SeniorMapper is under,more strangely is that after changing

   <mybatis:scan base-package="" />

to nonexisted package

   <mybatis:scan base-package="" />

I still got a similar warning:

WARNING: No MyBatis mapper was found in '[]' package. Please check your configuration.Nov 23, 2015 7:12:30 PM 

Not something like:package not existed,why?

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment