1

I have looked at this link but couldn't derive a solution to my problem:JAXB binding - "unable to honor this conversion customization"

I have this XML

<xs:simpleType name="auditory_stimuli">
    <xs:restriction base="xs:boolean"/>
</xs:simpleType>

Which I customized using this:

<xs:simpleType name="auditory_stimuli">
<xs:restriction base="xs:boolean">
    <xs:annotation>
        <xs:appinfo>
            <jaxb:javaType name="java.lang.Boolean"/>
        </xs:appinfo>
    </xs:annotation>
</xs:restriction>

However, when I run xjc, I get this exception

Specified javaType customization is not used.

Does anyone see what I am doing wrong?

Community
  • 1
  • 1

1 Answers1

0

<xs:annotation> and the remainder of the binding definition should be inside the <xs:simpleType> definition, not inside <xs:restriction>.

Try this..

<xs:simpleType name="auditory_stimuli">
    <xs:annotation>
        <xs:appinfo>
            <jaxb:javaType name="java.lang.Boolean"/>
        </xs:appinfo>
    </xs:annotation>
    <xs:restriction base="xs:boolean"/>
</xs:simpleType>

For something similar, see the following.. https://docs.oracle.com/javase/tutorial/jaxb/intro/custom.html#bnbch