Java Mybatis Error selecting key or setting result to parameter object

Mybatis 新增单个实体出现异常信息  
Error selecting key or setting result to parameter object
原因是你的实体类型,XML映射文件里的类型不一致导致报错
实体类型:
public class Entity{
        private Integer pKID;
}

Mybatis.xml文件配置
<insert id="Id" parameterType="Entity">
   	<selectKey resultType="java.lang.Long"   order="AFTER"  keyProperty="pKID">
          		SELECT LAST_INSERT_ID()
      	</selectKey>
</insert>

将实体中pKID属性 Integer类型改为Long
或者将映射文件返回类型改为Integer

 

2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器 : CHROME11 2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器版本 : 117.0.0.0 2025-11-04 16:47:11.740 ERROR 25365 --- [[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:11.741 ERROR 25365 --- [[ACTIVE] ExecuteThread: '25' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.388 ERROR 25365 --- [[ACTIVE] ExecuteThread: '56' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.417 ERROR 25365 --- [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.427 ERROR 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.511 ERROR 25365 --- [[ACTIVE] ExecuteThread: '63' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.521 ERROR 25365 --- [[ACTIVE] ExecuteThread: '36' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.547 ERROR 25365 --- [[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev 这是什么异常
最新发布
11-06
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值