异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep
Posted 飞鱼
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep相关的知识,希望对你有一定的参考价值。
Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
这个异常是数据库插入时违反数据库约束引起 ,例如主键重复、向非空字段插入空值,或者插入字段违反表结构等
由于现场没有及时反馈日志, 只能通过数据库信息排查
--查看SEQ 信息
SELECT US.*
FROM USER_SEQUENCES US
WHERE US.SEQUENCE_NAME IN
(‘SEQ_PAYMENT‘, ‘SEQ_PAYMENTDETAIL‘, ‘SEQ_PHYRESOURCE‘,
‘SEQ_DOCARDLOG‘, ‘SEQ_VOUCARDSALE‘, ‘SEQ_VOUCARDSALELIST‘);
--查看表信息
SELECT UT.TABLE_NAME, UT.NUM_ROWS
FROM USER_TABLES UT
WHERE UT.TABLE_NAME IN
(‘PAYMENT‘, ‘PAYMENTDETAIL‘, ‘PHYRESOURCE‘, ‘DOCARDLOG‘,
‘VOUCARDSALE‘, ‘VOUCARDSALELIST‘);
获取到日志后发现原因
ORA-01438: value larger than specified precision allowed for this column
; nested exception is java.sql.SQLException: ORA-01438: value larger than specified precision allowed for this column
OPERATORCREDITADJUSTLOG 表最大到999999 ,实际数量只有2W多, 单最大ID 已经到999992 ,造成这个原因是因为 SEQ 中设置了 cache =20 这个缓存失效 造成 SEQ 值的浪费
最后 修改表结构可 设置 更大 的值,同时讲 seq中的 cache 设置为0
以上是关于异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep的主要内容,如果未能解决你的问题,请参考以下文章
异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep
java 使用反射创建对象时异常 InstantiationException: Caused by: java.lang.NoSuchMethodException:
异常Caused by: java.lang.IllegalStateException: Method has too many Body parameters
1.spring异常:Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor(示例
AndroidStudio启动异常:Caused by: java.lang.IllegalArgumentException: Argument for @NotNull paramet
hibernate 出现Caused by: java.sql.SQLException: Column 'id' not found.异常