Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.11
    • Fix Version/s: 2.2.8 (JDK 8)
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Sun's DatatypeFactory#newXMLGregorianCalendar(String) and XMLGregorianCalendar
      which was buldled in jdk/jre6 lost backward compatibility in xsd:gMonth.

      JAXP said it as by-design, but in practice use, old format WAS LEGAL in several
      years, and many implimentations use old format now and for a while.

      So, Apache's xerces kept compatibility in the change (http://
      fisheye5.cenqua.com/browse/jaxp-sources/xml-xerces/java/src/com/sun/org/apache/
      xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java?r1=1.4&r2=1.5)

      This is critical especially in webservices, and JAXB is used in JAX-WS.
      I hope JAXB to take a practical way.

        Activity

        Hide
        kasaihiroyoshi added a comment -

        Created an attachment (id=308)
        fix in roughly same way to apache's xerces does.

        Show
        kasaihiroyoshi added a comment - Created an attachment (id=308) fix in roughly same way to apache's xerces does.
        Hide
        kasaihiroyoshi added a comment -

        JAXB prints gMonth in old style like "-12-+09:00" on JDK/JRE 6.
        But it cannot parse the "-12-+09:00" even though the text is printed by
        itsself !

        On JDK/JRE6, JAXB requires new style gMonth string in read,
        but it print gMonth string in old style.

        Attached patch lets it allow both of old and new style gMonth string in read.

        Show
        kasaihiroyoshi added a comment - JAXB prints gMonth in old style like "- 12 -+09:00" on JDK/JRE 6. But it cannot parse the "- 12 -+09:00" even though the text is printed by itsself ! On JDK/JRE6, JAXB requires new style gMonth string in read, but it print gMonth string in old style. Attached patch lets it allow both of old and new style gMonth string in read.
        Hide
        kasaihiroyoshi added a comment -

        Created an attachment (id=309)
        quick dirty switcher of printing format of gMonth. Defaulting old style as of now.

        Show
        kasaihiroyoshi added a comment - Created an attachment (id=309) quick dirty switcher of printing format of gMonth. Defaulting old style as of now.
        Hide
        Martin Grebac added a comment -

        Yardo, I think you just fixed this one - didn't you? If so, please update the status ...

        Show
        Martin Grebac added a comment - Yardo, I think you just fixed this one - didn't you? If so, please update the status ...
        Hide
        Iaroslav Savytskyi added a comment -

        The issue is fixed in 2.2.8.

        For backwards compatibility Matrin introduced system property: "jaxb.ri.useOldGmonthMapping". If it's set - we will use old format "-MM-" to parse gMonth. I'm not sure if xerces has some property to work with old format.

        Show
        Iaroslav Savytskyi added a comment - The issue is fixed in 2.2.8. For backwards compatibility Matrin introduced system property: "jaxb.ri.useOldGmonthMapping". If it's set - we will use old format "- MM -" to parse gMonth. I'm not sure if xerces has some property to work with old format.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: