简体   繁体   中英

error: cannot find symbol when call JAXB class's methods with Cyrillic symbol

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">

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM