栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

spring-bug集合

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

spring-bug集合

1.

org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession. The error may exist in SQL Mapper Configuration Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘LOOPED’. Cause: java.lang.ClassNotFoundException: Cannot find class: LOOPED


解决方法:

把LOOPED改为 POOLED 就好了

2.

org.apache.ibatis.binding.BindingException: Type interface com.jt.mapper.DemoUserMapper is not known to the MapperRegistry.


解决方法:


在demoUserMapper.xml 配置里把namespace 改为 com.jt.mapper.DemoUserMapper

3

org.apache.ibatis.binding.BindingException: Mapper method ‘com.jt.mapper.DemoUserMapper.find4’ has an unsupported return type: interface java.util.List

解决方案:
把find4 的返回值 删去即可

4.

解决方法: map list array 不能不是发生 把 array放入map中就行

5


解决方法: map list array 不能不是发生 把 list放入map中就行

6

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.DemoUserMapper.findAll


解决方案:
把id的值 变为findAll

7.

org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘minAge’, mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId=‘null’, jdbcTypeName=‘null’, expression=‘null’}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #3 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). The error may exist in mybatis/mappers/demoUserMapper.xml The error may involve defaultParameterMap The error occurred while setting parameters SQL: /select * from demo_user where age > ? and age < ?/ select * from demo_user where age > ? and age < ? Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘minAge’, mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId=‘null’, jdbcTypeName=‘null’, expression=‘null’}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #3 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

解决方案:
在DemoUserMapper.xml 中调整sql语句

8.

org.apache.ibatis.exceptions.PersistenceException:

Error building SqlSession. The error may exist in mybatis/mappers/demoUserMapper.xml Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 5; 注释中不允许出现字符串 “–”。

原因:
在demoUserMapper.xml 中插入了–

解决方案: 删去即可

9.

问题描述:

org.apache.ibatis.exceptions.PersistenceException:
###Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘age = 3000
sex = ‘男’’ at line 3
###The error may exist in mybatis/mappers/demoUserMapper.xml
###The error may involve defaultParameterMap
###The error occurred while setting parameters
###SQL: select id,name,age,sex from demo_user WHERe name = ? age = ? sex = ?
###Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘age = 3000
sex = ‘男’’ at line 3


原因:


sql语法错误 在where if 里 添加and就好了
解决方案:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/270205.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号