Struts validwhen causes frustration

M

msorvino

i'm having problems using the "validatewhen" validator. my application
makes use of the Struts Specification-Version: 1.2.4. Interestly, other
validators seem to work just fine. i have got control arrays working
properly with my other validators and ValidatorForm(s). The validwhen
clause is really throwing me for a loop. Any help would be appreciated.
The validator was configured as shown:

<field
property="windSpeed"
depends="validwhen">
<arg0 key="profileForm.layerDepth"/>
<var>
<var-name>test</var-name>
<var-value>((windDir == null)
or (*this* != null))</var-value>
</var>
</field>

After the following statement was entered in the validator.xml file,
the submit will thrown an exception. the exception message also shown
below is:

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)


root cause

java.lang.NoClassDefFoundError: antlr/TokenStream
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
java.lang.Class.getMethod0(Class.java:1901)
java.lang.Class.getMethod(Class.java:984)
org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:623)
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
org.apache.commons.validator.Field.validateForRule(Field.java:811)
org.apache.commons.validator.Field.validate(Field.java:890)
org.apache.commons.validator.Form.validate(Form.java:174)
org.apache.commons.validator.Validator.validate(Validator.java:367)
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:112)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:921)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:206)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)
 
W

Wendy S

msorvino said:
root cause
java.lang.NoClassDefFoundError: antlr/TokenStream

Do any of the .jar files in WEB-INF/lib contain this class? That's all it's
saying, that a class that was there when Validator was compiled is now
missing at runtime. I think you're missing 'antlr.jar'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,743
Latest member
WoodrowMea

Latest Threads

Top