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 is caused by the Counter service (not sure what it actually does and assume it generates unique IDs for prim ary keys).
These changes is in the Tomcat\webapps\root\web-inf\classes\portal-ext.properties file
# # # # counter#### The Counter operates with are 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 would 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 J DBC prefix allows better# fine tune the counter data source with its own set of configuration# settings for high AV Ailability installations. Note that these settings,# though separate, is a copy of the default settings with the newly# overridden values. #counter. jdbc.prefix=jdbc.counter.jdbc.counter.maxpoolsize=3jdbc.counter.minpoolsize=1jdbc.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