1

I have defined a ServiceType enumtype and Service itemtype in trainingcore-items.xml.

    <typegroup name="Services">
    <itemtype code="Service" autocreate="true" generate="true">
       <deployment typecode="23456" table="Service"/>
        <attributes>
            <attribute qualifier="code" type="localized:java.lang.String" autocreate="true" 
           generate="true">
                <persistence type="property"/>
                <description>Service Code</description>
                <modifiers unique="true" read="true" write="true"/>
            </attribute>
            <attribute qualifier="serviceType" type="localized:ServiceType" autocreate="true" 
          generate="true">
                <persistence type="property"/>
                <description>Service Type</description>
                <modifiers read="true" write="true"/>
            </attribute>
            <attribute qualifier="years" type="localized:java.lang.Integer" autocreate="true" 
            generate="true">
                <persistence type="property"/>
                <description>Service Years</description>
                <modifiers read="true" write="true"/>
            </attribute>



        </attributes>
    </itemtype>
</typegroup>


<enumtype code="ServiceType" autocreate="true" generate="true" dynamic="true">
    <value code="Basic"></value>
    <value code="BasicOnsite"></value>
    <value code="Advanced"></value>
</enumtype>

I have provided the localized values in the appropriate files: trainingcore_locales_en.properties:

type.Service.name=Service
type.Service.code.name=code
type.Service.serviceType.name=serviceType
type.Service.years.name=years

type.ServiceType.name=ServiceType
type.ServiceType.Basic.name=Basic
type.ServiceType.BasicOnsite.name=BasicOnsite
type.ServiceType.Advanced.name=Advanced


type.ProductServiceRelation.name= ProductServiceRelation

But when I'm running ant clean all, the build fails and I get this error :

java.lang.IllegalStateException: invalid descriptor Service.serviceType(localized:ServiceType):((trainingcore))::YAttributeDescriptor[trainingcore-items.xml:190(AttributeTagListener)][PROPERTY] due to missing type 'localized:ServiceType'

Please help me resolve this error.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user15948501
  • 87
  • 14
  • I think this is connected to your other question -> https://stackoverflow.com/questions/67946399/how-to-localize-a-custom-type-created-in-trainingcore-items-xml-in-hybris/67949205 I added a new answer. Feel free to accept the new answer. If my assumption is correct, then you can close this question about "localized:ServiceType". – geffchang Jun 12 '21 at 13:16
  • Should I remove localized from type="localized:ServiceType"? – user15948501 Jun 12 '21 at 14:57
  • Yes, change it to `type="ServiceType"` – geffchang Jun 12 '21 at 15:04

1 Answers1

1

This question is related to your another question: How to localize a custom type created in trainingcore-items.xml in Hybris?

Just change type="localized:ServiceType" to type="ServiceType" and it will be fine.

geffchang
  • 3,279
  • 2
  • 32
  • 58