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

Null pointer exception when attempting to bulk convert widget pages to content pages

    Details

    • Fix Priority:
      4
    • Sprint:
      Search|S03 Sprint 13| 3.16-4.6

      Description

      Steps:

      1. Create at least 2 widget pages in the default liferay site that uses a default layout template and add a navigation widget to one of the pages
      2. In Configuration > Server Administration > Script execute the API script(make sure to change the groupId to your sites groupId)
        BulkConversion.groovy
        import com.liferay.layout.util.BulkLayoutConverter
        import com.liferay.portal.kernel.util.ArrayUtil
        import com.liferay.registry.Registry
        import com.liferay.registry.RegistryUtil
        import org.osgi.framework.ServiceReference
        import org.osgi.framework.BundleContext
        
        Registry registry = RegistryUtil.getRegistry()
        
        BundleContext bundleContext = registry._bundleContext
        
        ServiceReference serviceReference = bundleContext.getServiceReference(BulkLayoutConverter.class.getName())
        
        BulkLayoutConverter bulkLayoutConverter = bundleContext.getService(serviceReference);
        
        long groupId = 20118 // Use your groupId
        
        long[] plids = bulkLayoutConverter.getConvertibleLayoutPlids(groupId)
        
        out.println("Convertible layouts before conversion:" + ArrayUtil.toStringArray(plids))
        
        long[] convertedLayoutPlids = bulkLayoutConverter.convertLayouts(groupId)
        
        out.println("Converted layouts:" + ArrayUtil.toStringArray(convertedLayoutPlids))
        
        plids = bulkLayoutConverter.getConvertibleLayoutPlids(groupId)
        
        out.println("Convertible layouts after conversion: " + ArrayUtil.toStringArray(plids))
        

      Expected Result:
      No error in console log

      Actual Result:
      Errors in console log

      2019-12-12 20:06:39.219 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.site.facet.portlet.SiteFacetPortlet.buildDisplayContext(SiteFacetPortlet.java:107)
      	at com.liferay.portal.search.web.internal.site.facet.portlet.SiteFacetPortlet.render(SiteFacetPortlet.java:86)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.255 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.type.facet.portlet.TypeFacetPortlet.buildDisplayContext(TypeFacetPortlet.java:105)
      	at com.liferay.portal.search.web.internal.type.facet.portlet.TypeFacetPortlet.render(TypeFacetPortlet.java:81)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.277 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.tag.facet.portlet.TagFacetPortlet.buildDisplayContext(TagFacetPortlet.java:106)
      	at com.liferay.portal.search.web.internal.tag.facet.portlet.TagFacetPortlet.render(TagFacetPortlet.java:79)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.295 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.category.facet.portlet.CategoryFacetPortlet.buildDisplayContext(CategoryFacetPortlet.java:112)
      	at com.liferay.portal.search.web.internal.category.facet.portlet.CategoryFacetPortlet.render(CategoryFacetPortlet.java:83)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.320 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.folder.facet.portlet.FolderFacetPortlet.buildDisplayContext(FolderFacetPortlet.java:104)
      	at com.liferay.portal.search.web.internal.folder.facet.portlet.FolderFacetPortlet.render(FolderFacetPortlet.java:80)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.343 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.user.facet.portlet.UserFacetPortlet.buildDisplayContext(UserFacetPortlet.java:102)
      	at com.liferay.portal.search.web.internal.user.facet.portlet.UserFacetPortlet.render(UserFacetPortlet.java:81)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      2019-12-12 20:06:39.385 ERROR [http-nio-8080-exec-10][render_portlet_jsp:131] null
      java.lang.NullPointerException
      	at com.liferay.portal.search.web.internal.modified.facet.display.context.ModifiedFacetDisplayBuilder.buildDefaultModifiedFacetTermDisplayContext(ModifiedFacetDisplayBuilder.java:163)
      	at com.liferay.portal.search.web.internal.modified.facet.display.context.ModifiedFacetDisplayBuilder.build(ModifiedFacetDisplayBuilder.java:71)
      	at com.liferay.portal.search.web.internal.modified.facet.portlet.ModifiedFacetPortlet.buildDisplayContext(ModifiedFacetPortlet.java:149)
      	at com.liferay.portal.search.web.internal.modified.facet.portlet.ModifiedFacetPortlet.render(ModifiedFacetPortlet.java:91)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
      	at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:571)
      	at com.liferay.portlet.internal.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:664)
      	at com.liferay.portlet.internal.InvokerPortletImpl.render(InvokerPortletImpl.java:344)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.lambda$render$0(MonitoringInvokerPortlet.java:259)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet._render(MonitoringInvokerPortlet.java:362)
      	at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:257)

      Reproduced on:
      Tomcat 9.0.17 + MySQL 5.7 Portal Master GIT ID: a79fa7ab73e5c23bd9e2ed05ae68969a1f53b609

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              brooke.dalton Brooke Dalton
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                33 weeks, 1 day ago

                  Packages

                  Version Package