[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 ...
随机推荐
- Sql Server中常用的6个自定义函数分享
转自:http://www.jb51.net/article/56691.htm IF OBJECT_ID('DBO.DISTINCT_STR') IS NOT NULL DROP FUNCTION ...
- hdu1403(后缀数组模板)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1403 题意: 给出两个字符串, 求他们的最长公共子串 思路: 两个字符串的最长公共子串长度显然就是两个 ...
- loj #6485. LJJ 学二项式定理 (模板qwq)
$ \color{#0066ff}{ 题目描述 }$ LJJ 学完了二项式定理,发现这太简单了,于是他将二项式定理等号右边的式子修改了一下,代入了一定的值,并算出了答案. 但人口算毕竟会失误,他请来了 ...
- C++基础学习4:引用
C++引用(Reference) 引用(Reference)是C++语言相对于C语言的又一个扩充,是C++常用的一个重要内容之一.类似于指针,只是在声明的时候用"&"取代了 ...
- 1.Tow Sum(两数和)
Level: Easy 题目描述: Given an array of integers, return indices of the two numbers such that they add ...
- ubuntu中出现:程序 'java' 已包含在下列软件包中的解决方法
已经安装sun java 在终端中输入java,出现以下提示: 程序 'java' 已包含在下列软件包中: * default-jre * gcj-4.8-jre-headless * gcj-4.9 ...
- 南昌大学航天杯第二届程序设计竞赛校赛网络同步赛 I
链接:https://www.nowcoder.com/acm/contest/122/I来源:牛客网 题目描述 小q最近在做一个项目,其中涉及到了一个计时器的使用,但是笨笨的小q却犯难了,他想请你帮 ...
- Jenkins自动化CI CD流水线之7--流水线自动化发布PHP项目
一.前提 环境为:lnmp PHP项目:wordpress(此处我们下载一个wordpress的源码.将其模拟为我们的代码上传到我们的git仓库) 二.配置 1)创建job 2)参数化构建 3)配置p ...
- 搭建element-ui Vue结构
1.安装淘宝镜像 npm install cnpm -g --registry=https://registry.npm.taobao.org 2.安装webpack cnpm install web ...
- Java——flush()方法
Java在使用流时,缓冲区是一种发送数据的高效方法,但当溢出缓冲区的部分需要用flush()方法强制将数据发送出去,不必等到缓冲区再次装满,尤其是在数据量特别小的情况下,如果不使用此方法,很容易出现流 ...