axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Mohn (JIRA)" <>
Subject [jira] Commented: (AXIS2-3001) Problem in 1.3 RC with deserialization of java.util.Date objects that are DateTime formatted.
Date Wed, 25 Jul 2007 13:36:31 GMT


Robert Mohn commented on AXIS2-3001:

I think your underlying assumption that a java Date object maps to a xml xs:date type is wrong.

A Date object and a Calendar object in java should both map to a xml xs:dateTime type, since
both objects contain both date and time.

Right now if I create a new Date object in java with a value of "2007-07-07 12:54pm", then
send that date object from a client to a server, the time portion would be stripped off, which
is incorrect.

And with how it's working now, it's actually worse than that... the wsdl that is automatically
created does map a java Date to a xs:dateTime in the schema -- so the serialization does work
correctly (Date gets passed over with both date and time portions), but the code to deserialize
the Date object does not work, it assumes that the xml type is 'date' and throws an exception
because it's not in YYYY-MM-DD format.

> Problem in 1.3 RC with deserialization of java.util.Date objects that are DateTime formatted.
> ---------------------------------------------------------------------------------------------
>                 Key: AXIS2-3001
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Axis 1.3 RC2, JDK 1.6 on Linux
>            Reporter: Sathija Pavuluri
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Blocker
>             Fix For: 1.3
> 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(
>         at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.makeDate(
>         at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getSimpleTypeObject(
>         at org.apache.axis2.databinding.utils.BeanUtil.deserialize(
>         at org.apache.axis2.databinding.utils.BeanUtil.processObject(
>         at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(
>         at org.apache.axis2.databinding.utils.BeanUtil.deserialize(
> 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. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message