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

NullPointerException thrown when BackgroundTask records exist from previous run.

    Details

      Description

      The Server Administration screen fails to render and an exception is thrown by the portal when records exist in the BackgroundTask table from a previous run that were not cleaned up. To workaround this, I deleted the records from the BackgroundTask table and restarted Tomcat.

      To Reproduce:

      1. From Control Panel -> Server Administration, start a full re-index, creating several BackgroundTask record entries.
      2. Kill the app server(in my case tomcat). If you don't have a lot of data, a kill -9 quickly after submitting the reindex will ensure you have left over data.
      3. Verify that there are Backgroundtask records left-over in the BackgroundTask table in your database.
      4. Start your app server
      5. Navigate to the Server Administration screen.

      You should now see an empty screen where the chart and all the functions(buttons) should appear along with the following error in your log.

      15:32:36,493 ERROR [http-nio-8080-exec-2][IncludeTag:128] Current URL /group/control_panel/manage?p_p_id=com_liferay_server_admin_web_portlet_ServerAdminPortlet&p_p_lifecycle=0&p_p_state=maximized generates exception: java.lang.NullPointerException
      java.lang.NullPointerException
      at com.liferay.portal.kernel.backgroundtask.display.BaseBackgroundTaskDisplay.getBackgroundTaskStatusAttributeLong(BaseBackgroundTaskDisplay.java:132)
      at com.liferay.portal.search.internal.background.task.display.ReindexBackgroundTaskDisplay.getPercentage(ReindexBackgroundTaskDisplay.java:36)
      at com.liferay.portal.kernel.backgroundtask.display.BaseBackgroundTaskDisplay.hasPercentage(BaseBackgroundTaskDisplay.java:77)
      at org.apache.jsp.resources_jsp._jspService(resources_jsp:973)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:399)
      at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:410)
      at com.liferay.portal.osgi.web.servlet.context.helper.internal.JspServletWrapper.service(JspServletWrapper.java:70)
      at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
      at com.liferay.portal.osgi.web.servlet.context.helper.internal.ServletContextHelperRegistrationImpl$RestrictPortletServletRequestFilter.doFilter(ServletContextHelperRegistrationImpl.java:447)
      at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
      at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
      at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
      at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:119)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 8 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP5
                7.0.0 DXP SP1
                7.0.3 CE GA4
                Master