首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我在海布里斯中本地化一个enumtype时,如何解析java.lang.IllegalStateException?

当我在海布里斯中本地化一个enumtype时,如何解析java.lang.IllegalStateException?
EN

Stack Overflow用户
提问于 2021-06-12 11:37:01
回答 1查看 669关注 0票数 1

我在培训核心-items.xml中定义了一个ServiceType enumtype和ServiceType。

代码语言:javascript
复制
    <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>

我在适当的文件中提供了本地化的值:trainingcore_locales_en.properties:

代码语言:javascript
复制
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

但是,当我运行时,构建失败了,我得到了以下错误:

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

请帮我解决这个错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-12 15:16:39

这个问题与你的另一个问题有关:How to localize a custom type created in trainingcore-items.xml in Hybris?

只要将type="localized:ServiceType"更改为type="ServiceType",就可以了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67948484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档