Consider defining a bean of type ‘tk.mybatis.mapper.common.Mapper’ in your configuration.

Description:
Field mapper in com.XXX.comm.BaseServiceImpl required a bean of type ‘tk.mybatis.mapper.common.Mapper’ that could not be found.
Action:
Consider defining a bean of type ‘tk.mybatis.mapper.common.Mapper’ in your configuration.

关键字:
No qualifying bean found for dependency [tk.mybatis.mapper.common.Mapper com.xx.model.QixiGameInfo>]: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.1.RELEASE)
...
...
...
...
...

[ WARN ] [2017-07-26 13:50:33:033] org.springframework.beans.factory.support.DefaultListableBeanFactory [1490] [main]- Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserInfoMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
[ WARN ] [2017-07-26 13:50:33:033] org.springframework.beans.factory.support.DefaultListableBeanFactory [1490] [main]- Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRelationMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserRelationMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
[ WARN ] [2017-07-26 13:50:33:033] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext [549] [main]- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queryGameListController': Unsatisfied dependency expressed through field 'xxxService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxxServiceImpl': Unsatisfied dependency expressed through field 'mapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean found for dependency [tk.mybatis.mapper.common.Mapper]: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\xxxMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserInfoMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRelationMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserRelationMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\xxxMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserInfoMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRelationMapper' defined in file [G:\workspace-s\xxWorkspace\qixi\qixi-dao\target\classes\com\xx\dao\UserRelationMapper.class]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.xx.dao.xxxMapper.universeListResultMap
[ INFO ] [2017-07-26 13:50:33:033] org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean [551] [main]- Closing JPA EntityManagerFactory for persistence unit 'default'
[ INFO ] [2017-07-26 13:50:33:033] com.alibaba.druid.pool.DruidDataSource [1383] [main]- {dataSource-1} closed
[ INFO ] [2017-07-26 13:50:33:033] org.apache.catalina.core.StandardService [183] [main]- Stopping service Tomcat
[ INFO ] [2017-07-26 13:50:33:033] org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer [101] [main]- 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
[ ERROR] [2017-07-26 13:50:33:033] org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter [42] [main]- 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field mapper in com.xx.comm.BaseServiceImpl required a bean of type 'tk.mybatis.mapper.common.Mapper' that could not be found.


Action:

Consider defining a bean of type 'tk.mybatis.mapper.common.Mapper' in your configuration.


这个问题找了两个小时!!!!!最后居然是大小写的问题。。。

<resultMap id="UListResultMap"  type="com.XXX.GameUniverseVO">  
resultMap>
<select id="queryUListById" parameterType="String" resultMap="uListResultMap">
select>

上边的resultMap引用的id大小写错误。。。崩溃

后来又会遇到类似的问题:
只要是找xml配置,你总会找到原因的。
比如parameterType写成了parameterMap等。

你可能感兴趣的:(报错案例)