Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3001

Problem in 1.3 RC with deserialization of java.util.Date objects that are DateTime formatted.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Duplicate
    • 1.3
    • 1.3
    • adb
    • None
    • Axis 1.3 RC2, JDK 1.6 on Linux

    Description

      This bug was introduced after the fix that was made for jira AXIS2-2701.
      I had originally written my comment against 2701 but since the bug is marked as resolved, thought this new issue should be tracked separately.

      The fix for AXIS2-2701 makes it impossible for java.util.Date objects to be deserialized when the date is datetime formatted (i.e. yyyy-mm-dd hh:mm:ss).
      It now only works for date format objects (i.e. yyyy-mm-dd)

      For example I have an object with attribute:
      java.util.Date timeStarted;

      The element in the response looks like this:
      <ax26:timeStarted>2007-07-23T13:20:46.861Z</ax26:timeStarted>

      The deserialization of this element fails with this exception:
      java.lang.RuntimeException: In valid string sufix
      at org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(ConverterUtil.java:378)
      at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.makeDate(SimpleTypeMapper.java:304)
      at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getSimpleTypeObject(SimpleTypeMapper.java:117)
      at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:364)
      at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:644)
      at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:592)
      at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:528)

      Looking at the code, it seems like the ConverterUtil expects the Date object to be only of yyyy-mm-dd format.
      It fails in the case when Date is yyyy-mm-dd hh:mm:ss formatted?

      Thanks,
      Sathija.

      Attachments

        1. pojosrc.zip
          2 kB
          Sathija Pavuluri
        2. man-service.aar
          6 kB
          Sathija Pavuluri

        Issue Links

          Activity

            People

              amilachinthaka Amila Chinthaka Suriarachchi
              spavuluri Sathija Pavuluri
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: