Search code examples
liferayliferay-themeliferay-7

StructureNameException: Name is null for locale with resources-importer


While I'm trying to import Page Layout with resource-importer, I'm facing this issue : The Article could not be loaded and the page could not be created, and I had this log Error :

09:13:33,693 ERROR [liferay/hot_deploy-1][SerialDestination:61] Unable to process message {destinationName=liferay/hot_deploy, response=null, responseDestinationName=null, responseId=null, payload=null, values={companyId=0, groupId=0, command=deploy, servletContextName=theme-galian}} com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.dynamic.data.mapping.exception.StructureNameException: Name is null for locale français (France)
        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
        at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
        at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:58)
        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:748) Caused by: com.liferay.dynamic.data.mapping.exception.StructureNameException: Name is null for locale français (France)
        at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1828)
        at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1791)
        at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.doUpdateStructure(DDMStructureLocalServiceImpl.java:1535)
        at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.updateStructure(DDMStructureLocalServiceImpl.java:1315)

Locale are setted correctly in portal-ext.proerties file :

locales=fr_FR

And for Structure, I'm defining structure with FR_fr as default language:

    {
        "availableLanguageIds": [
            "fr_FR",
            "en_US"
        ],
        "defaultLanguageId": "fr_FR",
        "fields": [
            {
                "label": {
                    "fr_FR": "Texte",
                    "en_US": "Texte"
.
.
.
.
.
.

I know that there was a bug https://issues.liferay.com/browse/LPS-60939 but it was resolved since 7.0.0 Alpha 5 Version.

I'm using Liferay 7.0 GA3 CE.

DO youhave any idea about this issue? Thanks


Solution

  • To fix this bug, you must add this properties as follows system-ext.properties

    user.country=FR
    user.language=fr
    

    And add this properties to portal-ext.properties:

    ##Locales
    locales=fr_FR
    
    #
    # Specify the locales that are enabled by default
    #
    locales.enabled=fr_FR
    
    #
    # This sets the default locale of the portal, overriding the properties
    # "user.language" and "user.country" specified in system.properties.
    #
    company.default.locale=fr_FR
    locale.default.request=false