Hi Karl,

Yes it was a known issue and as you pointed out has been fixed in the CVS. If I remember correctly the problem was that the Introspector wasn't using the proper handler for the Timestamp class. If you are unable to use the CVS version which contains the fix you should be able to simply specify the following FieldHandler class in a mapping file:

<field name="date" type="java.sql.Timestamp"
   handler="org.exolab.castor.xml.handlers.SQLTimestampFieldHandler"/>

That class already exists in the 0.9.6 jar.

Hope that helps,

--Keith


Baum, Karl A. wrote:
I am using castor version 0.9.6 and I am trying to marshal and unmarshal
java.sql.Timestamp objects.  I get the following exception when trying to
unmarshal a timestamp value: 2005-04-28T17:04:44.062-04:00

java.lang.IllegalStateException: java.lang.IllegalArgumentException:
Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
        at
org.exolab.castor.xml.handlers.EnumFieldHandler.setValue(EnumFieldHandler.ja
va:171)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:1016
)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:1084
)
        at
org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)

This timestamp value was created by the castor marshaller.  I downloaded the
latest snapshot and this issue has been resolved.  I am not sure we are
going to be able to use a snapshot.  I am wondering if this is a known issue
in version 0.9.6 and if there's a way I can get around it.  Thanks.

-karl





Reply via email to