Today, in the mapper. XML file, I mistakenly annotated it with /* * code description */
and then reported this error
the specific exception is as follows
Caused by: org.xml.sax.SAXParseException; lineNumber: 134; columnNumber: 10, The element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)+"。
error code
/** Public conditions */
<sql id="commonIfWhere">
<if test='params.projectId != null and params.projectId != ""'>
and project_id = #{params.projectId}
</if>
<if test='params.id!= null and params.id != ""'>
and id = #{params.id}
</if>
</sql>
after correction
<!-- Public conditions -->
<sql id="commonIfWhere">
<if test='params.projectId != null and params.projectId != ""'>
and project_id = #{params.projectId}
</if>
<if test='params.id!= null and params.id != ""'>
and id = #{params.id}
</if>
</sql>
The problem was solved smoothly
Read More:
- How to Solve Error: Element ‘dependency’ cannot have character [children], because the type’s content type is element-
- maven Error: Element ‘dependency’ cannot have character [children], because the type’s content type is
- [Solved] Error while extracting response for type [] and content type []…
- [Solved] ibatis.builder.BuilderException: Error parsing Mapper XML: Could not resolve type alias ‘XXX‘
- Tk.mapper Common mapper Error: Error creating bean with name ‘commonMapper‘ defined in file xxx
- [Solved] SpringBoot Error: HttpMediaTypeNotSupportedException: Content type ‘application/json‘ not supported
- [Solved] Eureka Startup Error: Root name (‘timestamp‘) does not match expected type EurekaApplications
- No match for ‘operator =’ both ends of the equal sign do not match
- [Solved] Mybatis crud insert error: org.apache.ibatis.binding.BindingException: Mapper method ‘com.liang.dao.UserMapper.addUser…
- Two implementation methods of spring boot scan mapper interface class
- [Solved] Springboot Reflection calls ServiceImpl Error: java.lang.NullPointerException, mapper is null
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- ### Error building SqlSession. ### The error may exist in com/itrs/mapper/UserMapper.xml ### Cause:
- [Solved] Error building SqlSession. ### The error may exist in com/itrs/mapper/OrderMapper.xml
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [Solved] error“:“element click intercepted“,“message“:“element click intercepted“
- [Solved] Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration.
- [Solved] QT cmak Compile Error: CMake Error: The source.. does not match the soused
- SpringBoot uses MyBatis error: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL)
- ElasticSearch Create Index Error: mapper_parsing_exception Root mapping definition has unsupported parameters