You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bryan-8 <my...@rnsolutions.com> on 2010/07/07 18:31:52 UTC

Unmarshalling Error

Using CXF 2.1.10, If the response XML contains empty tag for a Date Type e.g.
<EndDate/> or Decimal Type <Amount/>

JAXB throws a Unmarshalling Error

java.lang.NumberFormatException
        at java.math.BigDecimal.<init>(BigDecimal.java:457)
        at java.math.BigDecimal.<init>(BigDecimal.java:647)
        at
com.sun.xml.bind.DatatypeConverterImpl._parseDecimal(DatatypeConverterImpl.java:169)
        at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$23.parse(RuntimeBuiltinLeafInfoImpl.java:749)
        at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$23.parse(RuntimeBuiltinLeafInfoImpl.java:747)


after debugging CXF, i think the code that's causing this problem is
um.setEventHandler(null); in DataReaderImpl.

Is there a workaround for this?
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Unmarshalling-Error-tp1044775p1044775.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Unmarshalling Error

Posted by Daniel Kulp <dk...@apache.org>.
Well, there isn't a workaround for this as it's not a bug.   An empty element 
is not valid for any Decimal or Date type or anything like that.   Thus, it 
SHOULD throw an exception.   What are you expecting it to do?

Dan


On Wednesday 07 July 2010 12:31:52 pm Bryan-8 wrote:
> Using CXF 2.1.10, If the response XML contains empty tag for a Date Type
> e.g. <EndDate/> or Decimal Type <Amount/>
> 
> JAXB throws a Unmarshalling Error
> 
> java.lang.NumberFormatException
>         at java.math.BigDecimal.<init>(BigDecimal.java:457)
>         at java.math.BigDecimal.<init>(BigDecimal.java:647)
>         at
> com.sun.xml.bind.DatatypeConverterImpl._parseDecimal(DatatypeConverterImpl.
> java:169) at
> com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$23.parse(RuntimeB
> uiltinLeafInfoImpl.java:749) at
> com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$23.parse(RuntimeB
> uiltinLeafInfoImpl.java:747)
> 
> 
> after debugging CXF, i think the code that's causing this problem is
> um.setEventHandler(null); in DataReaderImpl.
> 
> Is there a workaround for this?

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog