Skip to content

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

Description

@Andrey-Metelyov

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions