[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 ...
随机推荐
- 关于nohup命令
nohup java -jar Test.jar --server.port=443 > console.log 2>&1 & 关于nohup命令 when using t ...
- oracle select非group by的字段
可以把group by的结果集当作一个表,然后从这里表里取数就可以了. e.g. SELECT A.PROJECT_CODE,A.DIE_NO,E.ONE_CONSUMING FROM (SELECT ...
- Linux之rsync数据同步服务
rsync是一个开源.快速的.多动能的.可以实现全量,增量的本地或远程数据同步备份工具,它适用于多种操作系统平台. 1.rsync的特性(功能) (1)支持拷贝特殊文件(如链接文件.设备文件) (2) ...
- ObjectARXWizards & AutoCAD .NET Wizards 下载地址
Autodesk Developer Network ObjectARX Wizards The ObjectARX Wizards for AutoCAD 2016 for Visual Stud ...
- xPath在C#中运用
<?xml version="1.0" encoding="utf-8" ?> <pets> <cat color=" ...
- 【NOIP 2009】靶形数独
题目描述 小城和小华都是热爱数学的好学生,最近,他们不约而同地迷上了数独游戏,好胜的他们想用数独来一比高低.但普通的数独对他们来说都过于简单了,于是他们向 Z 博士请教,Z 博士拿出了他最近发明的“靶 ...
- 将已有项目同步到远程git仓库(github,gitee)及giteee的visual studio插件使用一二
一.将已有项目同步到远程仓库的最简便方法是用git bash: 将已有项目同步到远程仓库有两种方法:1用git bash:2.用vs插件,两者的思路和步骤基本一致的. 实验发现,如果用vs插件,bas ...
- 解决部分在Debug模式下程序没问题但是Release模式下出现问题的方法
编译策略介绍 关于优化级别:GCC_OPTIMIZATION_LEVEL 描述如下 None: Do not optimize. [-O0]With this setting, the compil ...
- opencv-图片合成视频
无论视频的合成还是分解我们都需要进行解码器或者是编码器(因为视频不是一帧一帧进行存储的,而是进行过压缩编码.) import cv2 img = cv2.imread('image1.jpg') im ...
- git ssh密钥的使用
//配置邮箱,用户名, git config --global user.name git config --global user.email git config --global --list ...