springboot集成mybatis无法扫描到mapper.xml - weixin_41762420的博客 - CSDN博客

一、问题描述 
在做spring cloud微服务项目开发时,在进行其中一个微服务启动时,先是出现如下异常信息:

从报错信息中显示无法绑定到mapper接口中的方法。

二、尝试发现问题

1.首先查看mapper接口跟mapper.xml的映射关系以及sql的方法名是否对应。

对比完这些信息后发现都没有错误。

2.查看springboot注解是否正常

3.使用注解@Select 尝试看方法能否进入mapper接口

运行完发现可以正常访问数据,此时心里一万个不解。

三、解决问题

在application.properties或者application.yml中

mapper-locations这一项 路径改为:   com.guardlbt.thirdpay.thirdbank.dao/*.xml

问题已然得到解决。

重要信息

#mybatis
mybatis.type-aliases-package=cn.superdesk.app.core.dao.entity,cn.superdesk.app.organisation.dao.entity
mybatis.mapper-locations=classpath*:mapper/*Mapper.xml
mybatis.configuration.map-underscore-to-camel-case=true
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

classpath* 会扫jar包下边的东西

Checking to see if class cn.superdesk.app.core.dao.entity.AppMenuEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppRoleEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserFloorEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppRoleCompanyEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserSnLoginRecordEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserRoleEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserRepairTypeEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserCompanyEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppUserOrgnizationEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.core.dao.entity.AppRoleFunctionEntity matches criteria [is assignable to Object]
Scanned package: 'cn.superdesk.app.core.dao.entity' for aliases
Checking to see if class cn.superdesk.app.organisation.dao.entity.StaffEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserIntegralAccountEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.FloorEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.VirtualarchitectureEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.DepartmentEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserOperationRecodEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.VirtUserEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserActiveCountEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.VirtServiceEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.VirtPermConfigEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.MerchantOrgEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserEvaluateEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.HouseholdRoomEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.CompanyOrgEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.BuildEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.HouseholdRoomAuditEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.SmallSpaceEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserImageInfoEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.HouseholdEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.StaffOrgEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.CompanyEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.MerchantEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.VirtAccountEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.RoomNoEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserRepairTypeEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UnitEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.AccountRecordEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserAccountEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.WelfarePersonRecordEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.DeptEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserRepairEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.BuildOrgEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.StaffBuildEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.OrganizationEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.UserSubjectEntity matches criteria [is assignable to Object]
Checking to see if class cn.superdesk.app.organisation.dao.entity.WelfareRecordEntity matches criteria [is assignable to Object]
Scanned package: 'cn.superdesk.app.organisation.dao.entity' for aliases
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/TransitFixMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserFloorEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserOrgnizationEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserRoleEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppMenuEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppRoleEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserRepairTypeEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserSnLoginRecordEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppRoleCompanyMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppRoleFunctionEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-core-dao/2.0.0-SNAPSHOT/superdesk-app-core-dao-2.0.0-20191030.092739-6.jar!/mapper/AppUserCompanyEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/StaffEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/VirtAccountEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/AccountRecordEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserActiveCountEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserSubjectEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserOperationRecodEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserAccountEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/VirtualarchitectureEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/WelfarePersonRecordEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserRepairEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserIntegralAccountMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/VirtServiceEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/MerchantEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/BuildEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/DepartmentEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/OrganizationEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/WelfareRecordEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/SmallSpaceEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/CompanyEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/DeptEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/HouseholdRoomEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UnitEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/MerchantOrgEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/BuildOrgEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/HouseholdEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserImageInfoEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/CompanyOrgEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/VirtUserEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/FloorEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/RoomNoEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/VirtPermConfigEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserEvaluateEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/StaffOrgEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/UserRepairTypeEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/HouseholdRoomAuditEntityMapper.xml]'
Parsed mapper file: 'URL [jar:file:/home/linjinyu/.m2/repository/cn/superdesk/app/core/superdesk-app-organisation-dao/2.0.0-SNAPSHOT/superdesk-app-organisation-dao-2.0.0-20191030.092751-2.jar!/mapper/StaffBuildEntityMapper.xml]'

Original url: Access
Created at: 2019-10-25 17:05:15
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共0条评论