Uploaded image for project: 'PUBLIC - Liferay Portal Web Content Experience'
  1. PUBLIC - Liferay Portal Web Content Experience
  2. WCM-1362

Integrity Constraint Violation when creating Web Content Article

    Details

      Description

      Description

      When adding a Web Content Article with the Audience Targeting: User Sign In Rule enabled, an integrity constraint violation (Hypersonic) or Duplicate Entry (MySQL) error is displayed to the console upon refresh.

      Steps to reproduce

      1) Start the server.
      2) Deploy Audience Targeting.
      3) Under Site > Configuration > Audience Targeting, Add a User Segment with one rule that tracks whether a user is logged in or not.
      4) Add a web content display to the page, publish an article, and refresh the page.

      Results

      Expected Result: There should be no errors.
      Actual Results: JDBCExceptionReporter throws an error similar to the following:

      16:17:04,286 ERROR [liferay/analytics-5][JDBCExceptionReporter:234] integrity constraint violation: unique constraint or index violation: IX_4025F893
      16:17:04,289 ERROR [liferay/analytics-5][AnalyticsMessageListener:46] Unable to process message {destinationName=liferay/analytics, response=null, responseDestinationName=null, responseId=null, payload=null, values={pathContext=, groupId=0, classPK=31338, scopeGroupId=20143, anonymousUserId=31302, clientIP=127.0.0.1, uRLHome=http://localhost:8080/web/guest, companyGroupId=20152, stateMaximized=false, pathJavaScript=/o/frontend-js-web, statePopUp=false, plid=20146, analyticsKey=, defaultLanguageId=en_US, privateLayout=false, defaultLocale=en_US, layoutRelativeURL=/web/guest/home, companyId=20116, pathThemeRoot=/o/classic-theme, impersonated=false, controlPanel=false, bCP47LanguageId=en-US, className=com.liferay.journal.model.JournalArticle, virtualLayout=false, referrers={com.liferay.content.targeting.model.UserSegment=[J@5b0ba92f}, parentLayoutId=0, doAsUserIdEncoded=, siteGroupId=20143, pathThemeImages=http://localhost:8080/o/classic-theme/images, event=view, uRLControlPanel=/group/control_panel?refererPlid=20146, timestamp=2017-04-13T16:17:02.597Z, scopeGroupIdOrLiveGroupId=20143, cDNBaseURL=http://localhost:8080, languageId=en_US, parentGroupId=20143, stateExclusive=false, userAgent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36, sessionId=, userName=Test Test, layoutId=1, userId=20156, pathMain=/c, pathImage=/image, cDNHost=, layoutURL=http://localhost:8080/web/guest/home, portalURL=http://localhost:8080, signedIn=true, addSessionIdToURL=false, cDNDynamicResourcesHost=, freeformLayout=false, siteAdminURL=http://localhost:8080/group/guest/~/control_panel/manage?p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view}}
      org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
      	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
      	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      	at com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      	at com.liferay.portal.spring.hibernate.PortletTransactionManager$TransactionStatusWrapper.reset(PortletTransactionManager.java:260)
      	at com.liferay.portal.spring.hibernate.PortletTransactionManager.commit(PortletTransactionManager.java:63)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._commit(DefaultTransactionExecutor.java:128)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.commit(DefaultTransactionExecutor.java:36)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:46)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy758.updateContentVisited(Unknown Source)
      	at com.liferay.content.targeting.rule.visited.internal.messaging.AnalyticsMessageListener.doReceive(AnalyticsMessageListener.java:70)
      	at com.liferay.content.targeting.rule.visited.internal.messaging.AnalyticsMessageListener.receive(AnalyticsMessageListener.java:43)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.sql.BatchUpdateException: integrity constraint violation: unique constraint or index violation: IX_4025F893
      	at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(JDBCPreparedStatement.java:1937)
      	at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
      	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
      	at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
      	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
      	... 43 more
      

      Issue reproduced in the following environment
      2.x
      3dd9f04efc45cc6f51b4ecfcf3781de5f1f21f35

      7.0.x
      8ad28d14c7d2f5a79425fcbb320ba4658f377f8a

      Tomcat 8.0.32 + MySQL 5.7.18

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  3.0
                  2.2.0