File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Validator framework is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validator framework is not working" Watch "Validator framework is not working" New topic
Author

Validator framework is not working

selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
Hi,

I got the following error in my TOmcat server console while doing my validator example..
pls tell me what could be the problem..

SEVERE: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Objec
t, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Fi
eld, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletReques
t)
org.apache.commons.validator.ValidatorException: org.apache.struts.validator.Fie
ldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.Validat
orAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErr
ors, javax.servlet.http.HttpServletRequest)
at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val
idatorAction.java:627)
at org.apache.commons.validator.ValidatorAction.executeValidationMethod(
ValidatorAction.java:557)
at org.apache.commons.validator.Field.validateForRule(Field.java:811)
at org.apache.commons.validator.Field.validate(Field.java:890)
at org.apache.commons.validator.Form.validate(Form.java:174)
at org.apache.commons.validator.Validator.validate(Validator.java:367)
at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java
:112)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProc
essor.java:921)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:206)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
4)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:619)
at java.lang.Thread.run(Thread.java:536)
Cendy Nguvy
Ranch Hand

Joined: May 25, 2005
Posts: 37
Hi,

Try to modify in the "validator-rules.xml" file for each method parameter "org.apache.struts.action.ActionErrors" to "org.apache.struts.action.ActionMessages".

Or download Struts 1.2.4 validator-rules.xml.
[ July 07, 2005: Message edited by: cendy nguvy ]
selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
Hi cendy,

Thanks a lot ........................


It is working fine.....great !!!

regards
Selvi
selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
I have changed ActionErrors to ActionMessages in methodParams...

Got the error messages properly.No error in Tomcat console now...

thanks

regards
selvi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validator framework is not working