Resource importer fails to import structure when default language isn't english
Description
Activity

Kenji Heigel June 10, 2014 at 9:23 AM
No Longer Reproducible following the steps in the description along with Drew's instructions.
No Longer Reproducible on:
Tomcat 7.0.42 + MySQL 5.5. Portal master GIT ID: 41f950803ed9bbc822c73e3b9b4f6639f91885e7.
Plugins master GIT ID: 24bd4fcb857ee924ebd13b0765bd3de0cdcc3750.
No errors occur once the locale in the structure's .xml was changed. This was tested using the Welcome Theme.

Kenji Heigel June 5, 2014 at 9:27 AM
That's good to hear that it works. Thank you for your feedback regarding the error reporting. Because of this, I have created a Feature Request ticket, https://liferay.atlassian.net/browse/LPS-47437#icft=LPS-47437, that describes a user being notified when a theme's content is missing a locale.

Bob Brinks June 4, 2014 at 12:10 AM
Yes, this does work, thanks. A nice to have would be beter error reporting to the end-user, but it's fine this way.

Kenji Heigel June 3, 2014 at 4:01 PM
Hi Bob,
Thanks for reporting this issue. Drew has noted (in his comment above) that by setting available and default locals in the root tag, the resources importer will importer the structure correctly. Does this solution work for you? If so we may proceed to resolve this issue.
Thank you,
Kenji

Drew Brokke June 3, 2014 at 2:27 PMEdited
Not sure if this is really a bug, as you must also set the default locale of a structure as well. You can change it in the opening <root> tag of the structure XML like so:
<root available-locales="en_US, nl_NL" default-locale="nl_NL">
Now that the default locale of the content matches that of the portal, it imports perfectly.
This can be adjusted by the user in the structure editor GUI as well.
Assignee

Reporter

Steps to reproduce:
Create a theme with a structure for the resource importer.
Set company.default.locale=nl_NL in portal-ext.properties.
Deploy the resource-importer-web plugin
Deploy the theme.
Expected results:
The theme and structure should import correctly
Actual results:
The resource importer throws a StructureNameException if the default locale isn't english.
Console errors:
17:17:17,564 ERROR [liferay/hot_deploy-1][SerialDestination:69] Unable to process message {destinationName=liferay/hot_deploy, response=null, responseDestinationName=null, responseId=null, payload=null, values={groupId=0, command=deploy, companyId=0, servletContextName=welcome-theme}} com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portlet.dynamicdatamapping.StructureNameException at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32) at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72) at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:66) 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:722) Caused by: com.liferay.portlet.dynamicdatamapping.StructureNameException at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1780) at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1812) at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1770) at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.addStructure(DDMStructureLocalServiceImpl.java:160) at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.addStructure(DDMStructureLocalServiceImpl.java:286) 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:601) 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.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.$Proxy117.addStructure(Unknown Source) at com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil.addStructure(DDMStructureLocalServiceUtil.java:761) at com.liferay.resourcesimporter.util.FileSystemImporter.addDDMStructures(FileSystemImporter.java:377) at com.liferay.resourcesimporter.util.ResourceImporter.addDDMStructures(ResourceImporter.java:212) at com.liferay.resourcesimporter.util.FileSystemImporter.setupAssets(FileSystemImporter.java:1209) at com.liferay.resourcesimporter.util.FileSystemImporter.doImportResources(FileSystemImporter.java:975) at com.liferay.resourcesimporter.util.ResourceImporter.importResources(ResourceImporter.java:47) at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.initialize(ResourcesImporterHotDeployMessageListener.java:251) at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.onDeploy(ResourcesImporterHotDeployMessageListener.java:303) at com.liferay.portal.kernel.messaging.HotDeployMessageListener.doReceive(HotDeployMessageListener.java:55) at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26) ... 5 more