jaxb
  1. jaxb
  2. JAXB-721

Improve release documentation wrt JAXB-JDK dependencies

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: not determined
    • Component/s: docs
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      721

      Description

      xjc crashes on this simple schema (which compiles OK with 2.1.8 - 2.1.11):

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <element name="TestElement">
      <complexType>
      <choice minOccurs="0" maxOccurs="unbounded">
      <element name="element1" />
      <element name="element2" />
      </choice>
      </complexType>
      </element>
      </schema>

        Activity

        Hide
        Pavel Bucek added a comment -

        Can't reproduce - tried 2.1.12, 2.2, trunk, everything looks fine.

        Can you please provide a stacktrace and link to JAXB package which can't compile
        this schema?

        Thanks,
        Pavel

        Show
        Pavel Bucek added a comment - Can't reproduce - tried 2.1.12, 2.2, trunk, everything looks fine. Can you please provide a stacktrace and link to JAXB package which can't compile this schema? Thanks, Pavel
        Hide
        Pavel Bucek added a comment -

        closing as invalid, this is happening when you try using 2.2 RI with 2.1 API jar

        for "future generations":

        xjc throw following exception:

        parsing a schema...
        compiling a schema...
        Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
        at $Proxy5.required(Unknown Source)
        at
        com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReference(AbstractField.java:197)
        at
        com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(AbstractField.java:156)
        at
        com.sun.tools.xjc.generator.bean.field.AbstractListField.generate(AbstractListField.java:124)
        at
        com.sun.tools.xjc.generator.bean.field.UntypedListField.<init>(UntypedListField.java:107)
        at
        com.sun.tools.xjc.generator.bean.field.UntypedListFieldRenderer.generate(UntypedListFieldRenderer.java:72)
        at
        com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(DefaultFieldRenderer.java:79)
        at
        com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGenerator.java:747)
        at
        com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:535)
        at
        com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:235)
        at
        com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:175)
        at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)
        at com.sun.tools.xjc.Driver.run(Driver.java:343)
        at com.sun.tools.xjc.Driver.run(Driver.java:191)
        at com.sun.tools.xjc.Driver._main(Driver.java:116)
        at com.sun.tools.xjc.Driver.access$000(Driver.java:74)
        at com.sun.tools.xjc.Driver$1.run(Driver.java:96)
        Caused by: java.lang.NoSuchMethodException:
        javax.xml.bind.annotation.XmlElementRef.required()
        at java.lang.Class.getDeclaredMethod(Class.java:1954)
        at
        com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.java:107)
        ... 17 more

        To solve this, you have to be sure that jaxb-api.jar v2.2 will be used.
        There is no problem with jdk 1.5 but 1.6 has integrated jaxb-api v2.1 and you
        have to override that by putting jaxb-api.jar into jdk's endorsed dir.

        Show
        Pavel Bucek added a comment - closing as invalid, this is happening when you try using 2.2 RI with 2.1 API jar for "future generations": xjc throw following exception: parsing a schema... compiling a schema... Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at $Proxy5.required(Unknown Source) at com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReference(AbstractField.java:197) at com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(AbstractField.java:156) at com.sun.tools.xjc.generator.bean.field.AbstractListField.generate(AbstractListField.java:124) at com.sun.tools.xjc.generator.bean.field.UntypedListField.<init>(UntypedListField.java:107) at com.sun.tools.xjc.generator.bean.field.UntypedListFieldRenderer.generate(UntypedListFieldRenderer.java:72) at com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(DefaultFieldRenderer.java:79) at com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGenerator.java:747) at com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:535) at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:235) at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:175) at com.sun.tools.xjc.model.Model.generateCode(Model.java:286) at com.sun.tools.xjc.Driver.run(Driver.java:343) at com.sun.tools.xjc.Driver.run(Driver.java:191) at com.sun.tools.xjc.Driver._main(Driver.java:116) at com.sun.tools.xjc.Driver.access$000(Driver.java:74) at com.sun.tools.xjc.Driver$1.run(Driver.java:96) Caused by: java.lang.NoSuchMethodException: javax.xml.bind.annotation.XmlElementRef.required() at java.lang.Class.getDeclaredMethod(Class.java:1954) at com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.java:107) ... 17 more To solve this, you have to be sure that jaxb-api.jar v2.2 will be used. There is no problem with jdk 1.5 but 1.6 has integrated jaxb-api v2.1 and you have to override that by putting jaxb-api.jar into jdk's endorsed dir.
        Hide
        laune added a comment -

        JAXB_2_2_EA/docs/ReleaseNotes.html says "This release of the JAXB
        Reference Implementation requires J2SE 5.0 or higher." which has turned out to
        be misleading. Please include precise statements about the relation between a
        JAXB release and the JDK versions.

        If the "endorsed" mechanism must be used for some JAXB-JDK-combination,

        • add a link describing this mechanism;
        • which JAXB .jar's to store in ./endorsed (just jaxb-api.jar and jaxb-impl.jar,
          or ...?)
        Show
        laune added a comment - JAXB_2_2_EA/docs/ReleaseNotes.html says "This release of the JAXB Reference Implementation requires J2SE 5.0 or higher." which has turned out to be misleading. Please include precise statements about the relation between a JAXB release and the JDK versions. If the "endorsed" mechanism must be used for some JAXB-JDK-combination, add a link describing this mechanism; which JAXB .jar's to store in ./endorsed (just jaxb-api.jar and jaxb-impl.jar, or ...?)
        Hide
        Martin Grebac added a comment -

        I updated the docs to reflect current state, and also link to the endorsed dir description. With next release docs it should be live.

        Show
        Martin Grebac added a comment - I updated the docs to reflect current state, and also link to the endorsed dir description. With next release docs it should be live.

          People

          • Assignee:
            Martin Grebac
            Reporter:
            laune
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: