com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 -------------------------------

MuleSoft JIRA | Patrick Santana | 8 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Using the transformer XMLToObject, if you have inside the XML this: ... .... <createDate>2009-05-19T07:40:00</createDate> .... .... When I try to convert to the object using xml-to-object-transformer I got this exception: Exception stack trace: com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 ------------------------------- at com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:52) at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:31) at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:39) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46) at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66) A solution for that would be extend a little bit the transformer with some details like gregorian date, locale and others. To solve this problem, I will create a customize Transformer, like: import org.mule.api.transformer.TransformerException; import org.mule.module.xml.transformer.XmlToObject; import com.thoughtworks.xstream.converters.extended.ISO8601GregorianCalendarConverter; public class SoapMessageConverter extends XmlToObject { public SoapMessageConverter() { super(); try { getXStream().registerConverter(new ISO8601GregorianCalendarConverter()); } catch (TransformerException e) { throw new RuntimeException("unable to get xstream " + "in converter constructor "+e.getMessage()); } } }

    MuleSoft JIRA | 8 years ago | Patrick Santana
    com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 -------------------------------
  2. 0

    Using the transformer XMLToObject, if you have inside the XML this: ... .... <createDate>2009-05-19T07:40:00</createDate> .... .... When I try to convert to the object using xml-to-object-transformer I got this exception: Exception stack trace: com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 ------------------------------- at com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:52) at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:31) at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:39) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46) at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66) A solution for that would be extend a little bit the transformer with some details like gregorian date, locale and others. To solve this problem, I will create a customize Transformer, like: import org.mule.api.transformer.TransformerException; import org.mule.module.xml.transformer.XmlToObject; import com.thoughtworks.xstream.converters.extended.ISO8601GregorianCalendarConverter; public class SoapMessageConverter extends XmlToObject { public SoapMessageConverter() { super(); try { getXStream().registerConverter(new ISO8601GregorianCalendarConverter()); } catch (TransformerException e) { throw new RuntimeException("unable to get xstream " + "in converter constructor "+e.getMessage()); } } }

    MuleSoft JIRA | 8 years ago | Patrick Santana
    com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 -------------------------------

    Root Cause Analysis

    1. com.thoughtworks.xstream.converters.ConversionException

      Cannot parse date 2009-05-19T07:40:00 ---- Debugging information ---- class : com.vangenechten.system.edi.model.DelForHeader required-type : java.util.Date path : /com.vangenechten.system.edi.model.DelForHeader/createDate line number : 6 -------------------------------

      at com.thoughtworks.xstream.converters.basic.DateConverter.fromString()
    2. XStream Core
      AnnotationReflectionConverter.unmarshallField
      1. com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:52)
      2. com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:31)
      3. com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:39)
      4. com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      5. com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      6. com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      7. com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
      7 frames