错误:用Cyrillic符号调用JAXB类的方法时找不到符号 [英] error: cannot find symbol when call JAXB class's methods with Cyrillic symbol

查看:97
本文介绍了错误:用Cyrillic符号调用JAXB类的方法时找不到符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个错误的 XSD架构 - 在utf-8中的一个方法第一个符号'с'

I have an XSD schema with a mistake - in one method first symbol in utf-8 'с'

<xsd:attribute name="сreationDate" type="xsd:dateTime" use="required">

我从这个XSD生成Java类。但是当我在项目中调用此方法时,例如:

I generate Java classes from this XSD. But when I call this method in project for example:

quittanceType.setСreationDate(stringToXMLGregorianCalendar(new Date));

我的项目无法编译,我收到错误:

My project does not compile and I get error:


错误:找不到符号

error: cannot find symbol



    quittanceType.setСreationDate(stringToXMLGregorianCalendar(paymentsToCharge.getCreationDateStr()));
                     ^
  symbol:   method setСreationDate(XMLGregorianCalendar)
  location: variable quittanceType of type QuittanceType

但是在Macbook上,这个项目成功编译。我该怎么办?一切似乎都是正常的编码。

But on Macbook this project compiles successfully. What should I do? Everything seems to be normal encodings.

推荐答案

您最好使用绑定文件指定Java属性名称。

You should better specify the Java property name using binding file.

<jaxb:bindings
    version="1.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <jaxb:bindings 
        schemaLocation=".../myschema.xsd" 
        node="/xs:schema">

        <jaxb:bindings node="xs:complexType[@name='SomeType']/xs:attribute[@name='сreationDate']">
            <jaxb:property name="creationDate"/>
        </jaxb:bindings>
    </jaxb:bindings>

</jaxb:bindings>

我还通知了架构作者 - 以防他们想要纠正这个问题。

I'd also notified the schema authors - in case they would want to correct this.

这篇关于错误:用Cyrillic符号调用JAXB类的方法时找不到符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆