Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-67868

CI NullPointerException: CustomSQL clears SqlPool with possible threads reading SqlPool

    Details

      Description

      All modularized persistence tests will trigger CustomSQL to reload its configuration through running DBUgrader.upgrade(). This in turn will cause any CustomSQL.get(ID) to possibly attempt to read an entry in the SQL Pool Map. Currently DLFileRankFinderImpl runs a timely get in come cases in CI will collide with the clearing and reloading of the CustomSQL sqlPool map causing a null pointer exception:

      [exec] 19:47:45,017 ERROR [liferay/scheduler_dispatch-1][ParallelDestination:55] Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=null, values={GROUP_NAME=com.liferay.recent.documents.web.internal.messaging.RecentDocumentsMessageListener, companyId=0, groupId=0, DESTINATION_NAME=liferay/scheduler_dispatch, EXCEPTIONS_MAX_SIZE=0, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@1648d24, STORAGE_TYPE=MEMORY_CLUSTERED, JOB_NAME=com.liferay.recent.documents.web.internal.messaging.RecentDocumentsMessageListener}}
      [exec] com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.NullPointerException
      [exec] at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      [exec] at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:65)
      [exec] at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      [exec] at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      [exec] at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      [exec] at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      [exec] at java.lang.Thread.run(Thread.java:745)
      [exec] Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.NullPointerException
      [exec] at com.liferay.portlet.documentlibrary.service.persistence.impl.DLFileRankFinderImpl.findByStaleRanks(DLFileRankFinderImpl.java:62)
      [exec] at com.liferay.portlet.documentlibrary.service.impl.DLFileRankLocalServiceImpl.checkFileRanks(DLFileRankLocalServiceImpl.java:77)
      [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [exec] at java.lang.reflect.Method.invoke(Method.java:497)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
      [exec] at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85)
      [exec] at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:46)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:40)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      [exec] at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
      [exec] at com.sun.proxy.$Proxy215.checkFileRanks(Unknown Source)
      [exec] at com.liferay.recent.documents.web.internal.messaging.RecentDocumentsMessageListener.doReceive(RecentDocumentsMessageListener.java:89)
      [exec] at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      [exec] ... 6 more
      [exec] Caused by: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.NullPointerException
      [exec] at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:33)
      [exec] at com.liferay.portal.dao.orm.hibernate.SessionImpl.createSynchronizedSQLQuery(SessionImpl.java:143)
      [exec] at com.liferay.portal.dao.orm.hibernate.SessionImpl.createSynchronizedSQLQuery(SessionImpl.java:121)
      [exec] at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.createSynchronizedSQLQuery(ClassLoaderSession.java:196)
      [exec] at com.liferay.portlet.documentlibrary.service.persistence.impl.DLFileRankFinderImpl.findByStaleRanks(DLFileRankFinderImpl.java:50)
      [exec] ... 41 more
      [exec] Caused by: java.lang.NullPointerException
      [exec] at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
      [exec] at com.liferay.portal.dao.orm.common.SQLTransformer._transformFromJpqlToHql(SQLTransformer.java:361)
      [exec] at com.liferay.portal.dao.orm.common.SQLTransformer.transformFromJpqlToHql(SQLTransformer.java:51)
      [exec] at com.liferay.portal.dao.orm.hibernate.SessionImpl.createSynchronizedSQLQuery(SessionImpl.java:130)
      [exec] ... 44 more

      Fix must create a thread safe map and the ability to overwrite the sqlpool and clear possible stale IDs in map.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hong.zhao Hong Zhao
                Reporter:
                peter.fellwock Peter Fellwock (Inactive)
                Participants of an Issue:
                Recent user:
                Csaba Turcsan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 14 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP3
                  7.0.0 DXP SP1
                  7.1.X
                  Master