SAP Knowledge Base Article - Preview

2876452 - How to solve the exception: Invalid locale format in SAP Commerce Cloud

Symptom

 After doing the installation and a new language has been created with the wrong format, this can lead for the following exception when the user open Backoffice or Smartedit:

java.lang.IllegalArgumentException: Invalid locale format: z1 at org.apache.commons.lang.LocaleUtils.toLocale(LocaleUtils.java:104) at de.hybris.platform.commercefacades.storesession.converters.populator.LanguagePopulator.toLocale(LanguagePopulator.java:39) at de.hybris.platform.commercefacades.storesession.converters.populator.LanguagePopulator.populate(LanguagePopulator.java:34) at de.hybris.platform.commercefacades.storesession.converters.populator.LanguagePopulator.populate(LanguagePopulator.java:1) at de.hybris.platform.converters.impl.AbstractPopulatingConverter.populate(AbstractPopulatingConverter.java:73) at de.hybris.platform.converters.impl.AbstractConverter.convert(AbstractConverter.java:41) at de.hybris.platform.converters.Converters.convertAll(Converters.java:64) at de.hybris.platform.commercefacades.storesession.impl.DefaultStoreSessionFacade.getAllLanguages(DefaultStoreSessionFacade.java:234) at de.hybris.platform.cmsfacades.users.services.impl.DefaultCMSUserService.getAllSupportedLanguages(DefaultCMSUserService.java:103) at de.hybris.platform.cmsfacades.users.services.impl.DefaultCMSUserService.getLanguagesForUser(DefaultCMSUserService.java:84) at de.hybris.platform.cmsfacades.users.services.impl.DefaultCMSUserService.getReadableLanguagesForUser(DefaultCMSUserService.java:51) at de.hybris.platform.cmsfacades.users.services.impl.DefaultCMSUserService.getReadableLanguagesForCurrentUser(DefaultCMSUserService.java:45) at de.hybris.platform.cmsfacades.common.populator.impl.DefaultLocalizedPopulator.populate(DefaultLocalizedPopulator.java:40) at de.hybris.platform.cmsfacades.sites.populator.model.SiteModelPopulator.populate(SiteModelPopulator.java:47) at de.hybris.platform.cmsfacades.sites.populator.model.SiteModelPopulator.populate(SiteModelPopulator.java:1) at de.hybris.platform.converters.impl.AbstractPopulatingConverter.populate(AbstractPopulatingConverter.java:73) at de.hybris.platform.converters.impl.AbstractConverter.convert(AbstractConverter.java:41) at de.hybris.platform.cmsfacades.sites.impl.DefaultSiteFacade.lambda$3(DefaultSiteFacade.java:79) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1556) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at de.hybris.platform.cmsfacades.sites.impl.DefaultSiteFacade.getAllSiteData(DefaultSiteFacade.java:80) at de.hybris.platform.cmswebservices.sites.controller.SiteController.getAllSites(SiteController.java:58) at de.hybris.platform.cmswebservices.sites.controller.SiteController$$FastClassBySpringCGLIB$$3093f173.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671) at de.hybris.platform.cmswebservices.sites.controller.SiteController$$EnhancerBySpringCGLIB$$cd9e90ed.getAllSites(<generated>) at sun.reflect.GeneratedMethodAccessor719.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

 

I


Read more...

Environment

SAP Commerce Cloud version 1811

Product

SAP Commerce Cloud 1808 ; SAP Commerce Cloud 1811 ; SAP Commerce Cloud 1905

Keywords

  • IllegalArgumentException 
  • java.lang.IllegalArgumentException
  • Invalid locale format
  • locale format
  • LocaleUtils
  • org.apache.commons.lang.LocaleUtils.toLocale
, KBA , CEC-HCS-CCAZ-CZO , Customer Zone on Azure , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.