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

the roles import process is not database agnostic. The db driver of the portal that generate de lar file is needed

    Details

      Description


      the roles import process is not database agnostic. The db driver of the portal that generate de lar file is needed.

       

      Environment:
      Liferay DXP with for example a Sybase 15.X (or any kind of database whose drivers are not in the portal that import the .lar file)

      Reproduction Steps:
      1 - Go to Control Panel - Users - Roles - Export/Import
      2 - Go to Export - New Export Pocess
      3 - Leave the options by default
      4 - Export

      In other portal with other type of database:
      5 - Go to Control Panel - Users - Roles - Export/Import
      6 - Drag and Drop the .lar file created in the step 4
      7 - Continue
      8 - Leave the options by default
      9 - Import

      Expected behaviour:
      The .lar file is imported sucessfully

      Real behaviour:
      The import process failed and generated the following stack trace: 

      12:06:51,025 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:165] Unable to execute background task 
       com.liferay.exportimport.kernel.lar.PortletDataException: com.thoughtworks.xstream.converters.ConversionException: com.sybase.jdbc4.tds.SybTimestamp : com.sybase.jdbc4.tds.SybTimestamp_---- Debugging information ----_message             : com.sybase.jdbc4.tds.SybTimesta
       mp_cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException_cause-message       : com.sybase.jdbc4.tds.SybTimestamp_class               : com.liferay.portal.model.impl.RoleImpl_required-type       : com.liferay.portal.model.impl.RoleImpl_convert
       er-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter_path                : /Role/createDate_line number         : 13_version             : 1.4.7------------------------------- [Sanitized] 
              at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:389) 
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:290) 
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:826) 
              at com.liferay.exportimport.controller.PortletImportController.doImportPortletInfo(PortletImportController.java:612) 
              at com.liferay.exportimport.controller.PortletImportController.importFile(PortletImportController.java:227) 
              at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:373) 
              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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163) 
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54) 
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) 
              at com.sun.proxy.$Proxy90.importPortletInfo(Unknown Source) 
              at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:230) 
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:124) 
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:110) 
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl$CallableMethodInvocation.proceed(TransactionInvokerImpl.java:101) 
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54) 
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:47) 
              at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28) 
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:85) 
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:54) 
              at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43) 
              at com.liferay.portal.kernel.backgroundtask.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:56) 
              at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:124) 
              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:756) 
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667) 
              at java.lang.Thread.run(Thread.java:745) 
       Caused by: com.thoughtworks.xstream.converters.ConversionException: com.sybase.jdbc4.tds.SybTimestamp : com.sybase.jdbc4.tds.SybTimestamp_---- Debugging information ----_message             : com.sybase.jdbc4.tds.SybTimestamp_cause-exception     : com.thoughtworks.xstre
       am.mapper.CannotResolveClassException_cause-message       : com.sybase.jdbc4.tds.SybTimestamp_class               : com.liferay.portal.model.impl.RoleImpl_required-type       : com.liferay.portal.model.impl.RoleImpl_converter-type      : com.thoughtworks.xstream.convert
       ers.reflection.ReflectionConverter_path                : /Role/createDate_line number         : 13_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.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.exportimport.lar.PortletDataContextImpl.fromXML(PortletDataContextImpl.java:660) 
              at com.liferay.exportimport.lar.PortletDataContextImpl.getZipEntryAsObject(PortletDataContextImpl.java:1276) 
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil._getStagedModel(StagedModelDataHandlerUtil.java:442) 
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:353) 
              at com.liferay.roles.admin.internal.exportimport.data.handler.RolesAdminPortletDataHandler.doImportData(RolesAdminPortletDataHandler.java:145) 
              at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:382) 
              ... 35 more 
       Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.sybase.jdbc4.tds.SybTimestamp 
              at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79) 
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) 
              at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55) 
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) 
              at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88) 
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) 
              at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79) 
              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.MapperWrapper.realClass(MapperWrapper.java:30) 
              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.MapperWrapper.realClass(MapperWrapper.java:30) 
              at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.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.MapperWrapper.realClass(MapperWrapper.java:30) 
              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.MapperWrapper.realClass(MapperWrapper.java:30) 
              at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71) 
              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.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:401) 
              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.exportimport.lar.PortletDataContextImpl.fromXML(PortletDataContextImpl.java:660) 
              at com.liferay.exportimport.lar.PortletDataContextImpl.getZipEntryAsObject(PortletDataContextImpl.java:1276) 
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil._getStagedModel(StagedModelDataHandlerUtil.java:442) 
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:353) 
              at com.liferay.roles.admin.internal.exportimport.data.handler.RolesAdminPortletDataHandler.doImportData(RolesAdminPortletDataHandler.java:145) 
              at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:382) 
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:290) 
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:826) 
              at com.liferay.exportimport.controller.PortletImportController.doImportPortletInfo(PortletImportController.java:612) 
              at com.liferay.exportimport.controller.PortletImportController.importFile(PortletImportController.java:227) 
              at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:373) 
              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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163) 
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54) 
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:46) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137) 
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
              ... 23 more
      

       

       

      As additional information, I notice that in the xml files in the .lar file the timestamp is like this in a MySql environment:

       

      <__createDate class="sql-timestamp">2017-06-09 20:27:15.16</__createDate>   <__modifiedDate class="sql-timestamp">2017-06-09 20:27:15.16</__modifiedDate>
      

       

      But if the .lar was created from a portal with Sybase, the timestamp is like this:

       

      <__createDate class="com.sybase.jdbc4.tds.SybTimestamp" serialization="custom">
          <date>
            <long>1504905504000</long>
          </date>
          <sql-timestamp>
            <default>
              <nanos>462000000</nanos>
            </default>
          </sql-timestamp>
        </__createDate>
        <__modifiedDate class="com.sybase.jdbc4.tds.SybTimestamp" serialization="custom">
          <date>
            <long>1504905504000</long>
          </date>
          <sql-timestamp>
            <default>
              <nanos>462000000</nanos>
            </default>
          </sql-timestamp>
        </__modifiedDate>r
      

       

      I think that at this level the data should be agnostic to the database where de lar file created come from.

      The only way that it works is if paste the DB driver used in the portal that created de .lar file into the app server that import the file

       

       

        Attachments

          Activity

            People

            Assignee:
            lori.liu Lori Liu (Inactive)
            Reporter:
            rodrigo.mier Rodrigo De Mier
            Participants of an Issue:
            Recent user:
            Csaba Turcsan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 1 week ago

                Packages

                Version Package
                7.0.0 DXP FP39
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                7.1.0 M1
                7.1.X
                Master