jaxb
  1. jaxb
  2. JAXB-938

NullPointerException during marshalling object graph with XmlID and XmlIDRef

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.4u2
    • Fix Version/s: None
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Java 7 Update 10 on Windows 7

      Description

      The attached ZIP contains a Maven project with two test cases.
      For this issue, the classes, resources and test case in package com.jaxbtest.java7.bug1 are relevant.

      To reproduce:
      1.) make sure your current test environment is Java 7 Update 10
      For Maven 2.2.1 on Windows it means:
      a) set the JAVA_HOME variable to your Java 7 Update 10 JDK installation directory.
      b) prepend %JAVA_HOME%\bin to your Path.
      2.) run the unit tests in the project
      For Maven 2.2.1 it means:
      a) execute "mvn test" in the project root directory
      b) examine test result (look at ./target/surefire-reports/com.jaxbtest.java7.bug1.ReportFieldDefTestCase.txt)

      It should fail with a NullPointerException.
      You can import the project into Eclipse (m2e required!) for debugging.

      It works both with Java 6 Update 35 and JAXB 2.2.6 (may be fixed with JAXB-900 ?!).

      com.jaxbtest.java7.bug1.ReportFieldDefTestCas is the entry point for the test.
      ReportFieldDef is the XmlRootElement. It has a list of SimpleTypeField and ComplexTypeField. SimpleTypeField references a TextFormatImpl via interface and @XmlIDREF. TextFormatImpl has an id field with @XmlID.
      Unmarshalling an example document succeeds, but marshalling it back to a file fails then.

        Activity

        Hide
        brands added a comment -
        Show
        brands added a comment - Attachement is available here: http://glassfish.10926.n7.nabble.com/attachment/87486/0/jaxb-testcases.zip

          People

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

            Dates

            • Created:
              Updated: