You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Andrei Ivanov <an...@ines.ro> on 2004/01/02 01:48:23 UTC

Re: ErrorsTool ClassCastException

Indeed, it works with ActionError... I was using ActionMEssage because of 
http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionError.html

which says: "Deprecated. Please use ActionMessage instead, deprecated in 
struts 1.2.1 "

Thanks.

On Tue, 30 Dec 2003, Nathan Bubna wrote:

> Andrei Ivanov said:
> > I have a problem using ErrorsTool:
> >
> > $errors.all throws an exception:
> >
> > Invocation of method 'getAll' in class
> > org.apache.velocity.tools.struts.ErrorsTool threw exception class
> > java.lang.ClassCastException : null
> >
> > java.lang.ClassCastException
> > at org.apache.velocity.tools.struts.ErrorsTool.get(Unknown Source)
> > at org.apache.velocity.tools.struts.ErrorsTool.getAll(Unknown
> > Source)
> ...
> > The code from the struts action that creates the ActionErrors:
> >
> > ActionErrors errors = new ActionErrors();
> > errors.add(ActionMessages.GLOBAL_MESSAGE,
> > new ActionMessage("error.catalogexception", "error message");
> 
> ErrorsTool expects ActionError instances (subclass of ActionMessage).
> 
> > saveErrors(request, errors);
> >
> > I'm using struts-1.1 with latest cvs version of velocity and velocity
> > tools.
> >
> > What can I do ?
> 
> for now, use the ActionMessagesTool for ActionMessages and the ErrorsTool for
> ActionErrors.
> 
> for more on this, see this thread:
> http://marc.theaimsgroup.com/?t=107047691500003&r=1&w=2
> 
> Nathan Bubna
> nathan@esha.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org