zoukankan      html  css  js  c++  java
  • [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 tomcatwebappsROOTWEB-INFclassesportal-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
    
    
  • 相关阅读:
    C语言高速入口系列(七)
    数据结构:最小生成树--Prim算法
    poj2387-Til the Cows Come Home dijkstra获得水的问题
    iOS开展UI一片—简单的浏览器观看节目
    spark安装mysql与hive
    键入强力推进并解决强转
    华为u8800怎样root?
    用友ERP-U8最新破解(再次更新版本,附安装过程中的解决办法)
    Delphi 自带的那个 Hand 光标很难看?没关系,一行代码解决问题:
    阿里余额宝的来龙与去脉
  • 原文地址:https://www.cnblogs.com/chenyongblog/p/8044696.html
Copyright © 2011-2022 走看看