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

Unable to publish by "Date Range" due to a NPE thrown while creating date range

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 7.0.0 M3
    • Fix Version/s: 7.0.0 M1
    • Component/s: Staging
    • Labels:
      None

      Description

      When you try to publish a site and specify a date range, then press "Publish" button, process fails and following exception appears in the log:

      07:46:22,010 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:137] Unable to execute background task
      com.liferay.portal.kernel.exception.SystemException: java.lang.NullPointerException
              at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:105)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
              at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:111)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
              at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
              at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
              at java.util.Calendar.setWeekCountData(Calendar.java:2588)
              at java.util.Calendar.<init>(Calendar.java:956)
              at java.util.GregorianCalendar.<init>(GregorianCalendar.java:619)
              at com.liferay.portal.util.CalendarFactoryImpl.getCalendar(CalendarFactoryImpl.java:111)
              at com.liferay.portal.kernel.util.CalendarFactoryUtil.getCalendar(CalendarFactoryUtil.java:84)
              at com.liferay.portal.kernel.lar.ExportImportDateUtil.getCalendar(ExportImportDateUtil.java:192)
              at com.liferay.portal.kernel.lar.ExportImportDateUtil.getDateRange(ExportImportDateUtil.java:218)
              at com.liferay.portal.kernel.lar.ExportImportDateUtil.getDateRange(ExportImportDateUtil.java:123)
              at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:182)
              at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:1)
              at com.liferay.portal.spring.transaction.TransactionalCallableUtil$CallableMethodInvocation.proceed(TransactionalCallableUtil.java:84)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionalCallableUtil.call(TransactionalCallableUtil.java:36)
              at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:91)
              ... 8 more
      

      This is due to we are trying to create a calendar with null values for locale and timezone. Those values are hardcoded in StagingImpl.publishLayouts(). As a result, ExportImportConfiguration settings get stored with null values.

        Attachments

        1. fixed.png
          fixed.png
          60 kB
        2. reproduced.png
          reproduced.png
          67 kB

          Issue Links

            Activity

              People

              • Assignee:
                hong.zhao Hong Zhao
                Reporter:
                daniel.sanz Daniel Sanz
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 9 weeks, 4 days ago

                  Packages

                  Version Package
                  7.0.0 M1