commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard, Dan" <Dan.How...@Eclipsys.com>
Subject ClassCastException with BeanComparator
Date Wed, 08 Apr 2009 22:24:29 GMT
Hello all, 

 

I'm getting an exception in code 

 

java.lang.ClassCastException: java.lang.ClassCastException:
java.lang.String cannot be cast to java.math.BigDecimal

        at
org.apache.commons.beanutils.BeanComparator.compare(BeanComparator.java:
155)

 

I'm using BeanUtils 1.7.0 but when I download the source I see that this
class is not there anymore.  I can't see the source to see what's the
real issue.

 

What I have is a bean where some properties are Objects because I
determine the type dynamically (for custom fields). I read them from the
DB so in this case it's a Numeric field which comes back as BigDecimal.
The field is displayed on a web page to the user and they edit and
submit. At this point the bean property will be a String since It's
passed up through struts (Struts 1.2.9).

 

Any ideas how to solve?

 

Thanks!

 

 

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message