spring4gwt(+ mybatis) startup warning:No MyBatis mapper was found in '[com.vsi.idp.map.server.mappe]' package

171 views
Skip to first unread message

Alex Luya

unread,
Nov 23, 2015, 9:29:53 AM11/23/15
to GWT Users

My configuration is:

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

Mapper looks like:

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

ServiceImpl looks like:

package com.vsi.idp.map.server;
//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="com.vsi.idp.map.server.mapper" />

   //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 org.springframework.web.context.support.XmlWebApplicationContext 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 '[com.vsi.idp.map.server.mapper]' 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 package:com.vsi.idp.map.server.mapper,more strangely is that after changing

   <mybatis:scan base-package="com.vsi.idp.map.server.mapper" />

to nonexisted package

   <mybatis:scan base-package="com.vsi.idp.map.server.notexisted" />

I still got a similar warning:

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

Not something like:package not existed,why?

Reply all
Reply to author
Forward
0 new messages