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

Importing DDL LAR with DDL records which have either a blank integer, decimal and number field will result in failed import with com.thoughtworks.xstream.converters.ConversionException

    Details

      Description

      Description:
      When we import a DDL LAR which contains a record with a blank integer field, we will encounter a failed import due to the presence of values that read <null/>, instead of <int>SPECIFIED_INTEGER</int>

      Steps to reproduce:
      1. Start with any version of 6.2
      2. Create a new Data Definition with at least one integer, decimal, or number field
      3. Create a new DDL which uses the Data Definition you just created
      4. Add a new record to the new DDL. Leave one or more integer, decimal, or number fields blank
      5. Export the DDL Record. Use the default settings. (Exported LAR is attached from clean 6.2 EE SP14)
      6. Attempt to re-import the LAR.

      Expected Result:
      Import will initiate, then complete without any issues.

      Actual Results:
      Validation errors due to <null/> values in com.liferay.portlet.dynamicdatalists.model.DDLRecord entries.

      An unexpected error occurred with the publication process. Please check your portal and publishing configuration.
      com.thoughtworks.xstream.converters.ConversionException: com.thoughtworks.xstream.mapper.Mapper$Null : com.thoughtworks.xstream.mapper.Mapper$Null ---- Debugging information ---- message : com.thoughtworks.xstream.mapper.Mapper$Null cause-exception : com.thoughtworks.xstream.security.ForbiddenClassException cause-message : com.thoughtworks.xstream.mapper.Mapper$Null class : java.util.ArrayList required-type : java.util.ArrayList converter-type : com.thoughtworks.xstream.converters.collections.CollectionConverter path : /com.liferay.portlet.dynamicdatamapping.storage.Fields/_fieldsMap/entry/com.liferay.portlet.dynamicdatamapping.storage.Field/_valuesMap/entry/list/null line number : 13 class[1] : java.util.HashMap converter-type[1] : com.thoughtworks.xstream.converters.collections.MapConverter class[2] : com.liferay.portlet.dynamicdatamapping.storage.Field converter-type[2] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter class[3] : com.liferay.portlet.dynamicdatamapping.storage.Fields version : 1.4.7 -------------------------------

      Error trace:

      19:41:04,435 ERROR [liferay/background_task-2][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: com.thoughtworks.xstream.converters.ConversionException: com.thoughtworks.xstream.mapper.Mapper$Null : com.thoughtworks.xstream.mapper.Mapper$Null_---- Debugging information ----_message             : com.thoughtworks.xstream.mapper.Mapper$Null_cause-exception     : com.thoughtworks.xstream.security.ForbiddenClassException_cause-message       : com.thoughtworks.xstream.mapper.Mapper$Null_class               : java.util.ArrayList_required-type       : java.util.ArrayList_converter-type      : com.thoughtworks.xstream.converters.collections.CollectionConverter_path                : /com.liferay.portlet.dynamicdatamapping.storage.Fields/_fieldsMap/entry[2]/com.liferay.portlet.dynamicdatamapping.storage.Field/_valuesMap/entry/list/null_line number         : 29_class[1]            : java.util.HashMap_converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter_class[2]            : com.liferay.portlet.dynamicdatamapping.storage.Field_converter-type[2]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter_class[3]            : com.liferay.portlet.dynamicdatamapping.storage.Fields_version  : 1.4.7_------------------------------- [Sanitized]
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:175)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:340)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:330)
              at com.liferay.portlet.dynamicdatalists.lar.DDLPortletDataHandler.doImportData(DDLPortletDataHandler.java:194)
              at com.liferay.portal.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:327)
              at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:191)
              at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:1018)
              at com.liferay.portal.lar.PortletImporter.doImportPortletInfo(PortletImporter.java:533)
              at com.liferay.portal.lar.PortletImporter.importPortletInfo(PortletImporter.java:210)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:1895)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:1963)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:183)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at com.sun.proxy.$Proxy36.importPortletInfo(Unknown Source)
              at com.liferay.portal.service.LayoutLocalServiceUtil.importPortletInfo(LayoutLocalServiceUtil.java:1385)
              at com.liferay.portal.lar.backgroundtask.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:61)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:57)
              at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
              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: com.thoughtworks.xstream.converters.ConversionException: com.thoughtworks.xstream.mapper.Mapper$Null : com.thoughtworks.xstream.mapper.Mapper$Null_---- Debugging information ----_message             : com.thoughtworks.xstream.mapper.Mapper$Null_cause-exception     : com.thoughtworks.xstream.security.ForbiddenClassException_cause-message       : com.thoughtworks.xstream.mapper.Mapper$Null_class               : java.util.ArrayList_required-type       : java.util.ArrayList_converter-type      : com.thoughtworks.xstream.converters.collections.CollectionConverter_path                : /com.liferay.portlet.dynamicdatamapping.storage.Fields/_fieldsMap/entry[2]/com.liferay.portlet.dynamicdatamapping.storage.Field/_valuesMap/entry/list/null_line number         : 29_class[1]            :
      java.util.HashMap_converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter_class[2]            : com.liferay.portlet.dynamicdatamapping.storage.Field_converter-type[2]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter_class[3]            : com.liferay.portlet.dynamicdatamapping.storage.Fields_version             : 1.4.7_-------------------------------
       [Sanitized]
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
              at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
              at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
              at com.thoughtworks.xstream.converters.collections.MapConverter.putCurrentEntryIntoMap(MapConverter.java:110)
              at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:98)
              at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:92)
              at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:87)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:474)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:406)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
              at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
              at com.thoughtworks.xstream.converters.collections.MapConverter.putCurrentEntryIntoMap(MapConverter.java:110)
              at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:98)
              at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:92)
              at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:87)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:474)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:406)
              at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
              at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1169)
              at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1040)
              at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1031)
              at com.liferay.portal.lar.PortletDataContextImpl.fromXML(PortletDataContextImpl.java:836)
              at com.liferay.portal.lar.PortletDataContextImpl.getZipEntryAsObject(PortletDataContextImpl.java:1446)
              at com.liferay.portlet.dynamicdatalists.lar.DDLRecordStagedModelDataHandler.doImportStagedModel(DDLRecordStagedModelDataHandler.java:120)
              at com.liferay.portlet.dynamicdatalists.lar.DDLRecordStagedModelDataHandler.doImportStagedModel(DDLRecordStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:164)
              ... 34 more
      Caused by: com.thoughtworks.xstream.security.ForbiddenClassException: com.thoughtworks.xstream.mapper.Mapper$Null
              at com.thoughtworks.xstream.security.NoTypePermission.allows(NoTypePermission.java:26)
              at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:74)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
              at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
              at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
              at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:70)
              at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:98)
              at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:91)
              at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:85)
              at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
              ... 78 more

      Branch:
      Reproduced 24550fabf7

      Master:
      Resolved 63128527ff
      In master, the way we store the field content is different, so the issue isn't reproducible and the fix isn't back-portable.

        Attachments

        1. Fixed.PNG
          Fixed.PNG
          47 kB
        2. Reproduced.PNG
          Reproduced.PNG
          133 kB

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  6.2.X EE