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

NPE during LAR export in case a SiteNavigationMenuItem points to a non-existing Layout

    Details

      Description

      NPE during LAR export in case a SiteNavigationMenuItem points to a non-existing Layout

      Steps to reproduce

      1. Create a SiteNavigationMenuItem that points to a non-existing Layout, for example following LPS-99688 instructions
      2. Export the SiteNavigationMenuItem to a LAR file
        • Wrong behaviour: A NPE is produced:
          2019-08-13 07:35:42.210 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:173] Unable to execute background task                                                                   
          com.liferay.exportimport.kernel.lar.PortletDataException                                                                                                                                         
                  at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:149)                                                                 
                  at com.liferay.exportimport.data.handler.base.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:80)                                                           
                  at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:183)                                                                 
                  at com.liferay.site.navigation.service.base.SiteNavigationMenuItemLocalServiceBaseImpl$3.performAction(SiteNavigationMenuItemLocalServiceBaseImpl.java:377)                              
                  at com.liferay.site.navigation.service.base.SiteNavigationMenuItemLocalServiceBaseImpl$3.performAction(SiteNavigationMenuItemLocalServiceBaseImpl.java:370)                              
                  at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performAction(DefaultActionableDynamicQuery.java:394)                                                                 
                  at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:306)                                                                        
                  at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:268)                                                                        
                  at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.doPerformActions(DefaultActionableDynamicQuery.java:326)                                                              
                  at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performActions(DefaultActionableDynamicQuery.java:86)                                                                 
                  at com.liferay.site.navigation.internal.exportimport.data.handler.SiteNavigationMenuPortletDataHandler.doExportData(SiteNavigationMenuPortletDataHandler.java:153)                       
                  at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:141)                                                                                
                  at com.liferay.exportimport.internal.controller.PortletExportControllerImpl.exportPortletData(PortletExportControllerImpl.java:729)                                                      
                  at com.liferay.exportimport.internal.controller.PortletExportControllerImpl.exportPortlet(PortletExportControllerImpl.java:491)                                                          
                  at com.liferay.exportimport.internal.controller.PortletExportControllerImpl.doExport(PortletExportControllerImpl.java:945)                                                               
                  at com.liferay.exportimport.internal.controller.PortletExportControllerImpl.export(PortletExportControllerImpl.java:154)                                                                 
                  at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.exportPortletInfoAsFile(ExportImportLocalServiceImpl.java:150)                                             
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                           
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)                                                                                                         
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                 
                  at java.lang.reflect.Method.invoke(Method.java:498)                                                                                                                                      
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)                                                                                        
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)                                                                          
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)                                                                        
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)                                                                          
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)                                                                                   
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)                                                                                        
                  at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)                                                                                               
                  at com.sun.proxy.$Proxy151.exportPortletInfoAsFile(Unknown Source)                                                                                                                       
                  at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.exportPortletInfoAsFile(ExportImportLocalServiceUtil.java:85)                                                    
                  at com.liferay.exportimport.internal.background.task.PortletExportBackgroundTaskExecutor.execute(PortletExportBackgroundTaskExecutor.java:73)                                            
                  at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)                                                           
                  at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)                                            
                  at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:132)                                                 
                  at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)                                                                                          
                  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:752)                                                                              
                  at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)                                                                                   
                  at java.lang.Thread.run(Thread.java:748)                                                                                                                                                 
          Caused by: java.lang.NullPointerException                                                                                                                                                        
                  at com.liferay.exportimport.kernel.lar.ExportImportClassedModelUtil.getClassName(ExportImportClassedModelUtil.java:34)                                                                   
                  at com.liferay.exportimport.internal.lar.PortletDataContextImpl.addReferenceElement(PortletDataContextImpl.java:488)                                                                     
                  at com.liferay.site.navigation.menu.item.layout.internal.type.LayoutSiteNavigationMenuItemType.exportData(LayoutSiteNavigationMenuItemType.java:99)                                      
                  at com.liferay.site.navigation.internal.exportimport.data.handler.SiteNavigationMenuItemStagedModelDataHandler.doExportStagedModel(SiteNavigationMenuItemStagedModelDataHandler.java:73) 
                  at com.liferay.site.navigation.internal.exportimport.data.handler.SiteNavigationMenuItemStagedModelDataHandler.doExportStagedModel(SiteNavigationMenuItemStagedModelDataHandler.java:40) 
                  at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)                                                                 
                  ... 39 more                                                                                                                                                                              
          

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lu.liu Lu Liu
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 49 weeks, 1 day ago

                  Packages

                  Version Package
                  7.1.10 DXP FP14
                  7.1.X
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.1 CE GA2
                  7.2.X
                  7.3.10 DXP GA1
                  Master