jaxb
  1. jaxb
  2. JAXB-1014

eclipse Luna reports an error in classes generated by JAXB

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows 8.1 x64, eclipse Luna M6, JRE 7u55

      Description

      When generating Java classes for a simple xsd file, one of the generated Java classes shows the error
      The expected XML type associated with 'int' is not valid for XML element 'ARQPriority'
      but the xsd file seems correct, and the generated Java code also seems correct.
      Since I don't see a way to attach a file to the report, here is the sample xsd file, the error is in the Java class generated for ARQParameterSetType. If desired, I can provide the whole eclipse Luna project.

      <?xml version="1.0" encoding="UTF-8"?>
      <?xml-stylesheet type="text/xsl" href="xs3p.xsl"?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                  xmlns="http://test" 
                  xmlns:mdl="http://test" 
                  targetNamespace="http://test" 
                  elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xsd:element name="MDLRoot" type="MDLRootType"/>
        <xsd:complexType name="MDLRootType">
          <xsd:sequence>
            <xsd:element name="RadioLink" type="RadioLinkType" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="RadioLinkType">
          <xsd:sequence>
            <xsd:element name="ARQParameterSet" type="ARQParameterSetType" minOccurs="0" maxOccurs="8"/>
          </xsd:sequence>
          <xsd:attribute name="ID" type="xsd:ID" use="required"/>
        </xsd:complexType>
        <xsd:complexType name="ARQParameterSetType">
          <xsd:sequence>
            <xsd:element name="ARQPriority" type="ARQPriorityType"/>
          </xsd:sequence>
        </xsd:complexType>
        <xsd:simpleType name="ARQPriorityType">
          <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="7"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:schema>

        Activity

        Hide
        andreaMz added a comment -

        I used the bundle from the jaxb.java.net site to generate the Java classes. This time the generated class specifies
        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147
        like the classes generated by the eclipse JAXB project, and I still don't see any error message.

        There is still the possibility that the eclipse JAXB project would use some additional arguments that could cause a stricter validation, but I have not found anything that could have that effect, and I don't know how to see the xjc invocation done by the JAXB project.

        At this point I think I just need to wait to see if there will be any reaction to my post on the eclipse Dali forum.

        Thank you again for your help.

        Show
        andreaMz added a comment - I used the bundle from the jaxb.java.net site to generate the Java classes. This time the generated class specifies This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147 like the classes generated by the eclipse JAXB project, and I still don't see any error message. There is still the possibility that the eclipse JAXB project would use some additional arguments that could cause a stricter validation, but I have not found anything that could have that effect, and I don't know how to see the xjc invocation done by the JAXB project. At this point I think I just need to wait to see if there will be any reaction to my post on the eclipse Dali forum. Thank you again for your help.
        Hide
        Iaroslav Savytskyi added a comment -

        As I understand the problem is not in JAXB RI. I'll close the issue. If you will find a way (parameters, flags, etc) how to reproduce it with JAXB RI - please let me know.

        Show
        Iaroslav Savytskyi added a comment - As I understand the problem is not in JAXB RI. I'll close the issue. If you will find a way (parameters, flags, etc) how to reproduce it with JAXB RI - please let me know.
        Hide
        andreaMz added a comment -

        Before closing it, could you please do a quick search in the JAXB sources to see if the message
        The expected XML type associated with '<Java Class>' is not valid for XML element '<element name>'
        is generated anywhere?
        Thank you

        Show
        andreaMz added a comment - Before closing it, could you please do a quick search in the JAXB sources to see if the message The expected XML type associated with '< Java Class >' is not valid for XML element '< element name >' is generated anywhere? Thank you
        Hide
        Iaroslav Savytskyi added a comment -

        We don't have this message in JAXB. But it could be JAXP validation message.

        Show
        Iaroslav Savytskyi added a comment - We don't have this message in JAXB. But it could be JAXP validation message.
        Hide
        andreaMz added a comment -

        You must be absolutely correct: when I removed the validation builder (org.eclipse.wst.validation.validationbuilder) from the project, the error message disappeared.
        So I fully agree: you should close this issue.
        Thank you all for your help!

        Show
        andreaMz added a comment - You must be absolutely correct: when I removed the validation builder (org.eclipse.wst.validation.validationbuilder) from the project, the error message disappeared. So I fully agree: you should close this issue. Thank you all for your help!

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            andreaMz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: