jaxb
  1. jaxb
  2. JAXB-1005

Generation of classes with jaxb fails when an element is named "PRN"

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Eclipse Helios, Windows 7

      Description

      I am generating classes from a large xsd file. (Rightclick on pom in projectexplorer, run-as "maven generate sources") When I name an Element with "PRN" the generation process get stuck. It do not break and get also not to finished.
      When I rename the Element to PRN2 the same code works.
      Environment Helios, java 7, maven, maven-jaxb2 plugin 0.8.0 with basics and annotate 0.6.2. Jaxb version 2.2.7 (also tried 2.2.8 and 2.2.0 ...)
      Cant explain such a strange behavior, where the name of an element makes the generation to be stuck.

      Extraction from pom.xml
      <build>
      <plugins>
      <plugin>
      <groupId>org.jvnet.jaxb2.maven2</groupId>
      <artifactId>maven-jaxb2-plugin</artifactId>
      <version>0.8.0</version>
      <configuration>
      <schemaDirectory>src/main/resources</schemaDirectory>
      <bindingDirectory>src/main/resources</bindingDirectory>
      <generatePackage>migration.xml</generatePackage>
      <strict>true</strict>
      <extension>true</extension>
      <forceRegenerate>true</forceRegenerate>
      <generateDirectory>src/main/java</generateDirectory>
      <!-- <readOnly>true</readOnly> -->
      <verbose>true</verbose>

      <plugins>
      <plugin>
      <groupId>org.jvnet.jaxb2_commons</groupId>
      <artifactId>jaxb2-basics</artifactId>
      <version>0.6.2</version>
      </plugin>
      <plugin>
      <groupId>org.jvnet.jaxb2_commons</groupId>
      <artifactId>jaxb2-basics-annotate</artifactId>
      <version>0.6.2</version>
      </plugin>
      </plugins>
      <args>
      <arg>-Xannotate</arg>
      <!-- <arg>-XtoString</arg> -->
      </args>
      </configuration>
      <executions>
      <execution>
      <id>generate-sources</id>
      <goals>
      <goal>generate</goal>
      </goals>
      </execution>
      </executions>
      </plugin>

      <!-- plugin to add the jars to the generated jar. -->
      <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
      <descriptors>
      <descriptor>src/assemble/exe.xml</descriptor>
      </descriptors>
      <archive>
      <manifestFile>src/main/java/META-INF/MANIFEST.MF</manifestFile>
      </archive>
      </configuration>
      </plugin>
      </plugins>
      </build>

      The XSD fragment which do not work.

      <?xml version="1.0" encoding="UTF-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
      <xs:element name="PRN">
      <xs:annotation>
      <xs:documentation xml:lang="en">
      ProductRelation
      </xs:documentation>
      </xs:annotation>
      <xs:complexType>
      <xs:attribute name="A" use="required">
      <xs:annotation>
      <xs:documentation xml:lang="en">
      ProductIdRef
      </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
      <xs:restriction base="xs:IDREF">
      <xs:minLength value="4"/>
      <xs:maxLength value="14"/>
      <xs:pattern value="(PDT|PDT-)([0-9])+"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="B" use="required">
      <xs:annotation>
      <xs:documentation xml:lang="en">
      AmountValue
      </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
      <xs:restriction base="xs:long">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="2147483647"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:attribute>
      </xs:complexType>
      </xs:element>
      </xs:schema>

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated: