• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Error using Struts Validator  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm trying to use validator, but Tomcat throws the following exception:

18/04/2008 10:15:24 org.apache.struts.validator.ValidatorForm validate

SEVERE: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

org.apache.commons.validator.ValidatorException: No such validation method: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)

at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val
idatorAction.java:604)

...


*************************************************
The file validator-rules.xml seems to be correct:
*************************************************

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>

<global>

<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
msg="errors.required"/>

// other definitions

</global>

</form-validation>

*************************************************
And this is my validation.xml file:
*************************************************

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>
<formset>
<form name="ContactForm">
<field property="contact.company" depends="required">
<msg name="required" key="lilldep.error.company"/>
</field>
<field property="contact.name" depends="required">
<msg name="required" key="lilldep.error.name"/>
</field>
<field property="contact.email" depends="required">
<msg name="required" key="lilldep.error.email"/>
</field>
</form>
</formset>
</form-validation>

*************************************************

Please,

Somebody has already had this kind of problem and would help me to solve it ??

Thanks,

Marcos
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks like a problem that might occur if you have jar files from one Struts version and TLDs from another. Make sure that all the artifacts you reference in your project come from the same Struts download.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:jumpingjoy:
 
bhushanbrb bhange
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?

 
bhushanbrb bhange
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

bhushanbrb bhange wrote:

bhushanbrb bhange wrote:@Merrill
Consultant,can you please elaborate ?



 
bhushanbrb bhange
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Please Help me to solve above said error by 1st person (Class Not Found)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!