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

The com.liferay.portlet.dynamicdatamapping.TemplateNameException occurred when importing an LAR file.

    Description

    In trunk, the reproduction steps should be modified to:

    1) Start a TRUNK bundle and login the portal.
    2) Go to Control Panel and create a new Structure (and a Template) in the Web Content portlet for the default Liferay site.
    3) Stop the bundle and add the following properties to the portal-ext.properties file.
    company.default.locale=en_AU
    locales=en_AU,en_US
    locales.enabled=en_AU,en_US
    4) Start the bundle and make sure the Default Language of the portal has been configured to English (Australia) in Control Panel.
    5) Perform step 2 again and create another Structure (and a Template) in the Web Content portlet for the default Liferay site.
    6) Switch the Default Language of the portal back to English (United States) and export the Liferay site.
    7) Create a new blank site, configure its default language to a non-default one, say English (Australia) and then import the exported LAR file to that site.

    Or another reproduced steps:
    1. Set locales.enabled=ca_ES,zh_CN,nl_NL,en_US,fi_FI,fr_FR,de_DE,iw_IL,hu_HU,ja_JP,pt_BR,es_ES,en_AU in portal-ext.properties.
    2. Start Portal, go to Control Panel and create a new Structure (and a Template) in the Web Content portlet for the default Liferay site(en_US). And export the Web Content portlet "webcontent.lar".
    3. Go to Portal Settings, change Default Language from "en_US" to "en_AU".
    4. Create one blank site "Blank Site" and then go to "Blank Site" >Site Setting>Display Settings, define a custom default language "nl_NL" for this site.
    5. Go to "Blank Site"->Web Content, import the "webcontent.lar".

    Then you will face with the error message of:

    01:25:30,651 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:137] Unable to execute background task
    com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portlet.dynamicdatamapping.TemplateNameException
    at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:236)
    at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:299)
    at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:289)
    at com.liferay.portlet.journal.lar.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:245)
    at com.liferay.portal.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:409)
    at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:180)
    at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:627)
    at com.liferay.portal.lar.PortletImporter.doImportPortletInfo(PortletImporter.java:488)
    at com.liferay.portal.lar.PortletImporter.importPortletInfo(PortletImporter.java:199)
    at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:1957)
    at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:2025)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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:140)
    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:55)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
    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.$Proxy63.importPortletInfo(Unknown Source)
    at com.liferay.portal.service.LayoutLocalServiceUtil.importPortletInfo(LayoutLocalServiceUtil.java:1403)
    at com.liferay.portal.lar.backgroundtask.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:61)
    at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
    at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:111)
    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:662)
    Caused by: com.liferay.portlet.dynamicdatamapping.TemplateNameException
    at com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl.validateName(DDMTemplateLocalServiceImpl.java:1548)
    at com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl.validate(DDMTemplateLocalServiceImpl.java:1487)
    at com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl.validate(DDMTemplateLocalServiceImpl.java:1499)
    at com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl.validate(DDMTemplateLocalServiceImpl.java:1479)
    at com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl.addTemplate(DDMTemplateLocalServiceImpl.java:200)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
    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.$Proxy133.addTemplate(Unknown Source)
    at com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil.addTemplate(DDMTemplateLocalServiceUtil.java:430)
    at com.liferay.portlet.dynamicdatamapping.lar.DDMTemplateStagedModelDataHandler.addTemplate(DDMTemplateStagedModelDataHandler.java:215)
    at com.liferay.portlet.dynamicdatamapping.lar.DDMTemplateStagedModelDataHandler.doImportStagedModel(DDMTemplateStagedModelDataHandler.java:389)
    at com.liferay.portlet.dynamicdatamapping.lar.DDMTemplateStagedModelDataHandler.doImportStagedModel(DDMTemplateStagedModelDataHandler.java:1)
    at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:224)
    ... 52 more

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            lu.liu Lu Liu
            Reporter:
            eric.cheng Eric Cheng (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              6 years, 2 weeks, 4 days ago

                Packages

                Version Package
                6.2.2 CE GA3
                6.2.X EE
                7.0.0 M1