[JAVA][Liferay] Duplicate key value violates unique constraint for resourcepermissionid in Liferay
Unexpected exception thrown when create new site:
09:47:10,114 ERROR [ajp-bio-8009-exec-113][JDBCExceptionReporter:82] Batch entry 0 insert into ResourcePermission (companyId, name, scope, primKey, roleId, ownerId, actionIds, resourcePermissionId) values ('10157', 'com.liferay.portlet.documentlibrary.model.DLFileEntry', '4', '24728', '10173', '0', '3', '11366') was aborted. Call getNextException to see the cause.
09:47:10,115 ERROR [ajp-bio-8009-exec-113][JDBCExceptionReporter:82] ERROR: duplicate key value violates unique constraint "resourcepermission_pkey"_ Detail: Key (resourcepermissionid)=(11366) already exists. [Sanitized]
Solution:
The doubling was caused by the Counter service (not sure what it actually does but assume it generates unique ids for primary keys).
These changes are in the tomcat\webapps\ROOT\WEB-INF\classes\portal-ext.properties file
##
## Counter
##
#
# The counter operates with is own data source to prevent deadlocks. By
# default, the data source created for the counter uses the same settings as
# those used to create the data source used for the rest of the portal. That
# happens by because the counter service will look up the properties
# prefixed with "jdbc.default." to create its data source. See the JDBC
# properties prefixed with "jdbc.default." for more information.
#
# Setting a different value for the counter JDBC prefix allows you to better
# fine tune the counter data source with its own set of configuration
# settings for high availability installations. Note that these settings,
# though separate, are a copy of the default settings with the newly
# overridden values.
#
counter.jdbc.prefix=jdbc.counter.
jdbc.counter.maxPoolSize=3
jdbc.counter.minPoolSize=1
jdbc.counter.numHelperThreads=1
#
# Set the number of increments between database updates to the Counter
# table. Set this value to a higher number for better performance.
#
counter.increment=100
[JAVA][Liferay] Duplicate key value violates unique constraint for resourcepermissionid in Liferay的更多相关文章
- postgres 错误duplicate key value violates unique constraint 解决方案
SELECT setval('tablename_id_seq', (SELECT MAX(id) FROM tablename)+1) 主要是:serial key其实是由sequence实现的,当 ...
- ERROR: duplicate key value violates unique constraint "xxx"
在postgresql中,由于为表的主键建立了自增序列,且数据是从正式库拷贝到正式库的,所以报错如下: (主要原因:自增序列中的当前序列号小于真实数据中的最大主键值,因此在新增数据时,会报唯一值的错误 ...
- JDK8 stream toMap() java.lang.IllegalStateException: Duplicate key异常解决(key重复)
测试又报bug啦 接到测试小伙伴的问题,说是一个接口不返回数据了,好吧,虽然不是我写的接口任务落到头上也得解决,本地调试了一下,好家伙,直接抛了个异常出来,这又是哪位大哥喝醉了写的代码... Exce ...
- 大型网站技术架构(四)--核心架构要素 开启mac上印象笔记的代码块 大型网站技术架构(三)--架构模式 JDK8 stream toMap() java.lang.IllegalStateException: Duplicate key异常解决(key重复)
大型网站技术架构(四)--核心架构要素 作者:13GitHub:https://github.com/ZHENFENG13版权声明:本文为原创文章,未经允许不得转载.此篇已收录至<大型网站技 ...
- Caused by: java.lang.IllegalStateException: duplicate key: datasource
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/applicatio ...
- Java中List集合转Map集合报错:Duplicate key
一.问题由来 最近生成环境刚发布了一个版本,本人负责优化的一个功能在进行测试时,报错了一个异常,duplicate key;去百度里面看了一下, 意思很明确就是建重复,而且错误是在Java代码中抛出来 ...
- INSERT ... ON DUPLICATE KEY UPDATE Syntax
一 mybatis中返回自动生成的id 当有时我们插入一条数据时,由于id很可能是自动生成的,如果我们想要返回这条刚插入的id怎么办呢.在mysql数据中我们可以在insert下添加一个selectK ...
- ON DUPLICATE KEY UPDATE单个增加更新及批量增加更新的sql
转: ON DUPLICATE KEY UPDATE单个增加更新及批量增加更新的sql 本文为博主原创,转载请注明出处. 在实际应用中,经常碰到导入数据的功能,当导入的数据不存在时则进行添加,有修改时 ...
- Confluence 6 "Duplicate Key" 相关问题解决
如果你遇到了下面的错误信息,例如: could not insert: [bucket.user.propertyset.BucketPropertySetItem#bucket.user.prope ...
随机推荐
- yum源安装Percona
yum源安装更为简单,方便.话不多说,开始吧. 1.下载yum源 yum -y install https://www.percona.com/redir/downloads/percona-rele ...
- Linux errno错误对照表
errno 在 <errno.h> 中定义,错误 Exx 的宏定义在 /usr/include/asm-generic 文件夹下面的 errno-base.h 和 errno.h,分别定 ...
- 模板【洛谷P3390】 【模板】矩阵快速幂
P3390 [模板]矩阵快速幂 题目描述 给定n*n的矩阵A,求A^k 矩阵A的大小为n×m,B的大小为n×k,设C=A×B 则\(C_{i,j}=\sum\limits_{k=1}^{n}A_{i, ...
- SIGHUP信号
SIGHUP会在以下3种情况下被发送给相应的进程:1.终端关闭时,该信号被发送到session首进程以及作为job提交的进程(即用 & 符号提交的进程)2.session首进程退出时,该信号被 ...
- Unity 动画系统 AnimationEvent 动画事件
- 什么是Uboot
U-Boot的全称是Universal Boot Loader,遵循GPL条款的开放源码项目. U-Boot的作用是系统引导. U-Boot目前不仅仅支持嵌入式Linux系统的引导(对Linux的支持 ...
- 2016"百度之星" - 资格赛(Astar Round1) B
Problem Description 度熊面前有一个全是由1构成的字符串,被称为全1序列.你可以合并任意相邻的两个1,从而形成一个新的序列.对于给定的一个全1序列,请计算根据以上方法,可以构成多少种 ...
- 4 练习: 使用eclipse开发
1 练习: 使用eclipse开发 1.1 练习目标 本例讲述在使用eclipse如何创建groovy程序. 1.2 创建new Groovy project 本例假设你已经安装好了g ...
- python练习六十一:文件处理,读取文件内容
python练习六十一:文件处理,读取文件内容 假设要读取text.txt文件中内容 写文件(如果有文件,那直接调用就行,我这里自己先创建的文件) list1 = ['python','jave',' ...
- sklearn——回归评估指标
sklearn中文文档:http://sklearn.apachecn.org/#/ https://www.cnblogs.com/nolonely/p/7009001.html https://w ...