commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: [digester] SetNextRule and multiple children
Date Fri, 28 Mar 2003 16:33:43 GMT


On Fri, 28 Mar 2003, Durham David Cntr 805CSS/SCBE wrote:

> Date: Fri, 28 Mar 2003 08:22:10 -0600
> From: Durham David Cntr 805CSS/SCBE <David.Durham1@scott.af.mil>
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> Subject: RE: [digester] SetNextRule and multiple children
>
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> >
> >
> > An InvocationTargetException normally means that the method you told
> > Digester to call via reflection (here, the add() method on your
> > ActionConstraint class) threw an exception.  Is there anything in your
> > add() method that might cause this on the second invocation?
>
> That's makes sense since the root cause was a ClassCastException.  ActionConstraint is
an extension of TreeSet and I did not override add().
>
> Here's the root cause:
>
> Caused by: java.lang.ClassCastException: mil.usaf.rad.dpart.struts.Group
> 	at java.util.TreeMap.compare(TreeMap.java:1081)
> 	at java.util.TreeMap.put(TreeMap.java:459)
> 	at java.util.TreeSet.add(TreeSet.java:205)
>
>
> Does this mean that Group needs to implement Comparable?
>

Yes, unless you supply your own Comparator to the constructor.

>
> I solved my problem by changing ActionConstraint to extend HashSet.
>

That's another way to fix it.

> >
> > Craig
> >
>
> Dave
>

Craig

Mime
View raw message