Skip to Content
author's profile photo Former Member
Former Member

How do I extend customer to add new attributes and implement its converter,populator ? Can you please tell the steps for such implementation ?

I have extended Customer to add 3 attributes

             <deployment table="CromaCustomer" typecode="12000" />
             <attributes>
                 <attribute autocreate="true" qualifier="mobile" type="java.lang.String">
                     <modifiers read="true" write="true" search="true"
                         optional="true" />
                     <persistence type="property" />
                     <description>Mobile number of customer</description>
                 </attribute>
                 
                 <attribute autocreate="true" qualifier="dateOfBirth" type="java.lang.String">
                     <modifiers read="true" write="true" search="true"
                         optional="true" />
                     <persistence type="property" />
                     <description>Date of Birth of customer</description>
                 </attribute>
                 <attribute autocreate="true" qualifier="marriageAnniversary" type="java.lang.String">
                     <modifiers read="true" write="true" search="true"
                         optional="true" />
                     <persistence type="property" />
                     <description>Marriage Anniversary of customer</description>
                 </attribute>
             </attributes>
     </itemtype>

I have created converter and populator inside my facade layer . However on server startup i get this error

| org.springframework.beans.FatalBeanException: Context hybris Global Context Factory couldn't be created correctly due to, Error creating bean with name 'myCustomerConverter' defined in class path resource [myfacades-spring.xml]: Cannot resolve reference to bean 'myCustomerPopulator' while setting bean property 'populators' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myCustomerPopulator' defined in class path resource [myfacades-spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'de.hybris.platform.commerceservices.converter.impl.AbstractPopulatingConverter' to required type 'com.my.web.facades.user.converter.myCustomerConverter' for property 'myCustomerConverter'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [de.hybris.platform.commerceservices.converter.impl.AbstractPopulatingConverter] to required type [com.my.web.facades.user.converter.myCustomerConverter] for property 'myCustomerConverter': no matching editors or conversion strategy found

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 06, 2017 at 09:06 AM

    No need to extend the converter here as you are adding some new attributes in CustomerModel, so just write a CustomCustomerPopulator and populate your new attributes. And while bean definition just give the alias as "customerPopulator".

    alias name="customCustomerPopulator" alias="customerPopulator"/>

    Hope it solves your issue !!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.