场景:导入MybatisX-Generator(也就是MybatisX的代码生成器)
运行项目出现:
Error creating bean with name 'sysMenuController': Unsatisfied dependency expressed through field 'sysMenuService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysMenuServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysMenuMapper' defined in file。。。
解决:
resources中的xml文件的type没有改过来。。。
<resultMap id="BaseResultMap" type="com.atguigu.model.system.SysRoleMenu">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="roleId" column="role_id" jdbcType="BIGINT"/>
<result property="menuId" column="menu_id" jdbcType="BIGINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
</resultMap>
检查了好久。。ε=(´ο`*)))唉
总结:
这类问题一般都是导包或者注释没有写好(比如实现类的@Service等等),每个可能涉及的文件都看一遍就好啦,o(* ̄︶ ̄*)o