白日梦想家Zzzzz 2022-04-21 17:19 采纳率: 60%
浏览 47
已结题

mybatis 解析xml异常,已查看class无重复,target已删除,项目clean,xml id没有重复!!急!!

报错信息

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: mocha.snservice.service.sl.InformationService mocha.snservice.controller.bs.TypeAction.informationService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'informationService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private mocha.snservice.mapper.sl.InformationMapper mocha.snservice.service.sl.InformationService.informationMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [mocha.snservice.mapper.sl.InformationMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

BeanCreationException: Error creating bean with name 'informationMapper' defined in file [D:\apache-tomcat-8.5.16\webapps\framework_v4_snservice\WEB-INF\classes\mocha\snservice\mapper\sl\InformationMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for mocha.snservice.mapper.sl.InformationMapper.BaseResultMap

xml


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper SYSTEM "http://mybatis.org/dtd/mybatis-3-mapper.dtd" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN">

-<mapper namespace="mocha.snservice.mapper.sl.InformationMapper">


-<resultMap type="mocha.snservice.entity.sl.Information" id="BaseResultMap">

<id property="id" jdbcType="INTEGER" column="ID"/>

<result property="createUserId" jdbcType="VARCHAR" column="CREATE_USER_ID"/>

<result property="createUserName" jdbcType="VARCHAR" column="CREATE_USER_NAME"/>

<result property="createDeptId" jdbcType="VARCHAR" column="CREATE_DEPT_ID"/>

<result property="createDeptName" jdbcType="VARCHAR" column="CREATE_DEPT_NAME"/>

<result property="createTime" jdbcType="TIMESTAMP" column="CREATE_TIME"/>

<result property="infoTitle" jdbcType="VARCHAR" column="INFO_TITLE"/>

<result property="infoType" jdbcType="VARCHAR" column="INFO_TYPE"/>

<result property="tabId" jdbcType="VARCHAR" column="TAB_ID"/>

<result property="tabName" jdbcType="VARCHAR" column="TAB_NAME"/>

<result property="labelId" jdbcType="VARCHAR" column="LABEL_ID"/>

<result property="labelName" jdbcType="VARCHAR" column="LABEL_NAME"/>

<result property="attrId" jdbcType="VARCHAR" column="ATTR_ID"/>

<result property="orderId" jdbcType="VARCHAR" column="ORDER_ID"/>

<result property="viewNum" jdbcType="INTEGER" column="VIEW_NUM"/>

<result property="isDel" jdbcType="VARCHAR" column="IS_DEL"/>

<result property="isUp" jdbcType="VARCHAR" column="is_up"/>

<result property="extend2" jdbcType="VARCHAR" column="EXTEND2"/>

<result property="extend3" jdbcType="VARCHAR" column="EXTEND3"/>

<result property="extend4" jdbcType="VARCHAR" column="EXTEND4"/>

<result property="extend5" jdbcType="VARCHAR" column="EXTEND5"/>

<result property="infoDesc" jdbcType="VARCHAR" column="INFO_DESC"/>

</resultMap>

-<resultMap type="mocha.snservice.entity.sl.Information" id="ResultMapWithBLOBs" extends="BaseResultMap">

<result property="infoDesc" jdbcType="LONGVARCHAR" column="INFO_DESC"/>

</resultMap>


-<sql id="Example_Where_Clause">
-<where>

-<foreach separator="or" item="criteria" collection="oredCriteria">

-<if test="criteria.valid">

-<trim suffix=")" prefixOverrides="and" prefix="(">

-<foreach item="criterion" collection="criteria.criteria">
-<choose>

<when test="criterion.noValue">and ${criterion.condition} </when>

<when test="criterion.singleValue">and ${criterion.condition} #{criterion.value} </when>

<when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when>

-<when test="criterion.listValue">
and ${criterion.condition} 
<foreach separator="," item="listItem" collection="criterion.value" open="(" close=")">#{listItem} </foreach>

</when>

</choose>

</foreach>

</trim>

</if>

</foreach>

</where>

</sql>

-<sql id="Update_By_Example_Where_Clause">
-<where>
-<foreach separator="or" item="criteria" collection="example.oredCriteria">

-<if test="criteria.valid">

-<trim suffix=")" prefixOverrides="and" prefix="(">
-<foreach item="criterion" collection="criteria.criteria">
-<choose>

<when test="criterion.noValue">and ${criterion.condition} </when>
<when test="criterion.singleValue">and ${criterion.condition} #{criterion.value} </when>
<when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when>

-<when test="criterion.listValue">
and ${criterion.condition} 
<foreach separator="," item="listItem" collection="criterion.value" open="(" close=")">#{listItem} </foreach>

</when>

</choose>

</foreach>

</trim>

</if>

</foreach>

</where>

</sql>

<sql id="Base_Column_List">ID, CREATE_USER_ID, CREATE_USER_NAME, CREATE_DEPT_ID, CREATE_DEPT_NAME, CREATE_TIME,INFO_TITLE, INFO_TYPE, TAB_ID, TAB_NAME, LABEL_ID, LABEL_NAME, ATTR_ID, ORDER_ID,VIEW_NUM, IS_DEL, is_up, EXTEND2, EXTEND3, EXTEND4, EXTEND5,INFO_DESC </sql>

<sql id="Blob_Column_List">INFO_DESC </sql>


-<select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="mocha.snservice.entity.sl.InformationExample">
select 

</select>


-<select id="selectByExample" resultMap="BaseResultMap" parameterType="mocha.snservice.entity.sl.InformationExample">
select *from service_information si 
<where>si.TAB_ID=#{tabId}order by si.VIEW_NUM DESC,si.CREATE_TIME DESC </where>

</select>

<select id="selectByTabName" resultMap="BaseResultMap">select * from service_informationwhere TAB_NAME = #{tabName} </select>

<select id="selectByPage" resultMap="BaseResultMap">select * from service_information </select>


-<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String">
select 
<include refid="Base_Column_List"/>
, 
<include refid="Blob_Column_List"/>
from service_informationwhere ID = #{id,jdbcType=INTEGER} 
</select>

<delete id="deleteByPrimaryKey" parameterType="java.lang.String">delete from service_informationwhere ID = #{id,jdbcType=INTEGER} </delete>
</delete>

<insert id="insert" parameterType="mocha.snservice.entity.sl.Information">insert into service_information (ID, CREATE_USER_ID, CREATE_USER_NAM</insert>


-<insert id="insertSelective" parameterType="mocha.snservice.entity.sl.Information">
insert into service_information 
</insert>


-<select id="countByExample" parameterType="mocha.snservice.entity.sl.InformationExample" resultType="java.lang.Long">
select count(*) from service_information </select>


-<update id="updateByExampleSelective" parameterType="map">
update service_information 

<if test="record.id != null">ID = #{record.id,jdbcType=INTEGER}, </if>

<if test="record.createUserId != null">CREATE_USER_ID = #{record.createUserId,jdbcType=VARCHAR}, </if>

<if test="record.createUserName != null">CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR}, </if>

</update>


-<update id="updateByExampleWithBLOBs" parameterType="map">

</update>


-<update id="updateByExample" parameterType="map">
</update>


-<update id="updateByPrimaryKeySelective" parameterType="mocha.snservice.entity.sl.Information">
update service_information </update>

<update id="updateByPrimaryKeyWithBLOBs" parameterType="mocha.snservice.entity.sl.Information">update service_informationset CREATE_USER_ID </update>

<update id="updateByPrimaryKey" parameterType="mocha.snservice.entity.sl.Information">update service_informationset CREATE_USER_ID = #{createU</update>

</mapper>

  • 写回答

2条回答 默认 最新

  • haikuokuangtu 2022-04-21 17:30
    关注

    这么多这个干嘛的,也不是注释啊

    img

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 6月7日
  • 创建了问题 4月21日

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题