commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <>
Subject Re: Digester crashes in run mode and succeeds with java debugger
Date Mon, 16 Jul 2012 14:28:51 GMT
Hi Stepan,

I guess that in debug mode, inside your IDE JVM, the invoked method is
public void setFf(String date); OTOH, when running from console, log
clearly show that JVM invokes public void setFf(Date date);

You have two options:

 * drop the Date argument support (less good, IMHO);

 * Rely on Date only and configure BeanUtils doing its job - the
Digester relies on BeanUtils to perform text to Java object
unmarshalling, so for Date type you have to plug the needed converter.
(which is a better/cleaner approach)

Have a look at "Data Type Conversions"[1] to understand how to convert
the extracted XML body text to Date; basically you have
to instantiate a DateConverter[2] and register it via the
ConvertUtils.html#register()[3] method.
The Digester will do the rest.

HTH and don't hesitate on writing back to the ML if needed!
All the best,


On Mon, Jul 16, 2012 at 4:11 AM, Stepan Yakovenko <> wrote:
> HI
> I've got application that uses digerster. There is a bean with two setters:
> public void setFf(String date);
> public void setFf(Date date);
> Crash happens here:
> org.apache.commons.beanutils.ConversionException: DateConverter does
> not support default String to 'Date' conversion.
>         at org.apache.commons.beanutils.converters.DateTimeConverter.toDate(
>         at org.apache.commons.beanutils.converters.DateTimeConverter.convertToType(
>         at org.apache.commons.beanutils.converters.AbstractConverter.convert(
>         at org.apache.commons.beanutils.converters.ConverterFacade.convert(
>         at org.apache.commons.beanutils.ConvertUtilsBean.convert(
>         at org.apache.commons.beanutils.BeanUtilsBean.setProperty(
>         at org.apache.commons.beanutils.BeanUtilsBean.populate(
>         at org.apache.commons.beanutils.BeanUtils.populate(
>         at org.apache.commons.digester3.SetPropertiesRule.begin(
>         at org.apache.commons.digester3.Digester.startElement(
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
>         at org.apache.commons.digester3.Digester.parse(
> (line numbers may slightly deviate because I've added tracing printlns)
> When I try to debug this, no crash happens. Is this a known issue?
> Thanx.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message