两种方案: 用queryForList方法替换queryForObject或者queryForMap,因为这两个方法必须要有值,不能为空. 把这个异常捕获,用try/catch. 这个查询的结果是null,没有数据所以就提示acual 为0.而查询的时候是期望查询有结果有记录,并且记录数是1. spring 这个查询中没有查询到数据就报错.解决方案就是要查询有结果,或者换一种查询方式.…
public Wcrash getWcrashInfo(int id) { String sql = "select plateform_id,android_version,app_version_code,app_version_name,device_id," + "model,brand,product,stack_trace,crash_date,package_name from wcrash where id = ? "; return this.jd…
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition 解决办法: 在执行service中一个方法bume…
问题描述: 一个业务复杂.执行时间很长的功能,经常报出“基础链接已经关闭:接收时发生错误”,很是蹊跷... 问题分析: 首先,查阅应用服务器的系统日志,发现问题发生时总是会伴随着w3wp进程崩溃的错误,很有问题呀... 错误存储段 ,类型 0 事件名称: APPCRASH 响应: 不可用 Cab Id: 0 问题签名: P1: w3wp.exe P2: 7.5.7601.17514 P3: 4ce7afa2 P4: oracommon11.dll P5: 11.2.0.3 P6: 4eb215c…
最近学习ssh框架,总是出现这问题,后查证是没有开启事务. 如果采用注解方式,直接在业务层加@Transactional 并引入import org.springframework.transaction.annotation.Transactional; 详细信息,可以参考下面博客: 参考资料:http://blog.csdn.net/longxia1987/article/details/7819242 org.springframework.dao.InvalidDataAccessApi…
通过这个简单的案例,手把手教给你分析异常信息(适合初学者看) org.springframework.dao.InvalidDataAccessApiUsageException: The given id must not be null!; nested exception is java.lang.IllegalArgumentException: The given id must not be null! at org.springframework.orm.jpa.EntityMan…
题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后更快的解决此类问题. BUG的报错信息如下所示: org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integ…
报错如下: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement at org.springframework.orm.jpa.vendor.HibernateJpaDialect.co…
java.lang.RuntimeException: org.springframework.dao.DuplicateKeyException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '149187842867995' for key 'PRIMARY'### The erro…
异常信息: org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: com.blog.entity.PersonalizedSettings; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: com.bl…