Skip to content

<jaxb:globalBindings optionalProperty="primitive"> causes NullPointerException #43

Open
@Andrey-Metelyov

Description

When i add xsd:annotation block with <jaxb:globalBindings optionalProperty="primitive">, exception occurs:

Execution failed for task ':xjcGenerate'.
> A failure occurred while executing org.unbrokendome.gradle.plugins.xjc.work.xjc23.XjcGeneratorWorkAction
   > java.lang.NullPointerException (no error message)

example of modified Books.xsd:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:tns="http://unbroken-dome.org/gradle-xjc-plugin/samples/books"
            xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
            jaxb:version="1.0"
            targetNamespace="http://unbroken-dome.org/gradle-xjc-plugin/samples/books">

  <xsd:annotation>
    <xsd:appinfo>
      <jaxb:globalBindings optionalProperty="primitive">
        <jaxb:serializable/>
      </jaxb:globalBindings>
    </xsd:appinfo>
  </xsd:annotation>

  <xsd:complexType name="bookType">
    <xsd:attribute name="title" type="xsd:string"/>
    <xsd:attribute name="author" type="xsd:string"/>
    <xsd:attribute name="bestseller" type="xsd:boolean"/>
    <xsd:attribute name="publicationYear" type="xsd:gYear"/>
  </xsd:complexType>

  <xsd:element name="book" type="tns:bookType"/>

  <xsd:complexType name="booksType">
    <xsd:sequence>
      <xsd:element ref="tns:book"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="books" type="tns:booksType"/>

</xsd:schema>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions