You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Janice <ja...@shaw.ca> on 2003/12/18 22:22:12 UTC

ClassCastException coming from DynaValidatorForm.validate()

Hello all,

I did have validation, etc, working in another application, but now I'm
starting a new application and I'm getting an error that I can't explain.

When I submit my form, I call:
ActionErrors errors = form.validate(mapping, request);

which spits up this error:
** error stuff starts here **
java.lang.ClassCastException: java.lang.String

	org.apache.struts.action.ActionErrors
org.apache.struts.validator.DynaValidatorForm.validate(org.apache.struts.act
ion.ActionMapping, javax.servlet.http.HttpServletRequest)

		DynaValidatorForm.java:141

	org.apache.struts.action.ActionForward
ca.bc.gov.srm.bart.actions.AnnouncementActions.submitForm(org.apache.struts.
action.ActionMapping, org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)

		AnnouncementActions.java:137

	java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object[])

		native code
** error stuff ends here, well, there's lots more of that, but you probably
don't need to see the whole thing... **

All of my .jars and .tlds and .dtds are from the 1.1 release of Struts.  I
am using jDeveloper, but I was with the other application as well.

I think my validation.xml and validator-rules.xml are being read, since if I
put a typo in either one, the typo gets caught.

This is my form definition:
    <form-bean name="announcementForm"
               type="org.apache.struts.validator.DynaValidatorForm" >
               <form-property name="id" type="java.lang.String" />
               <form-property name="page" type="java.lang.String" />
               <form-property name="type" type="java.lang.String" />
               <form-property name="heading" type="java.lang.String" />
               <form-property name="desc" type="java.lang.String" />
               <form-property name="expiry" type="java.lang.String" />
               <form-property name="sequence" type="java.lang.String" />
    </form-bean>

I can remove everything from my validation.xml file that pertains to this
form (its the first one), and the error still happens, so I don't think its
got anything to do with my code in there.

I would really, really appreciate some insight into this problem!
Janice

ps: Seasons' Greetings!


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