This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Validator : Invalid validation type  RSS feed

 
Hitesh Kumar C
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was trying to achieve vaidation using Struts2 custom Validation, i 've defined the configuration as per the process.

Custom Validator :



Action:



UserRegistration-validation.xml:


validation.xml:



JSP:


Struts-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">




while running this application it is giving me this error

02:44:15,121 ERROR [com.opensymphony.xwork2.validator.AnnotationActionValidatorManager] Caught exception while loading file mypackage/UserRegistration-validation.xml: Invalid validation type: customeemail - field-validator - file:///E:/Servers/jboss-6.1.0.Final/bin/mypackage/UserRegistration-validation.xml:33:39
at com.opensymphony.xwork2.validator.DefaultValidatorFileParser.addValidatorConfigs(DefaultValidatorFileParser.java:181) [:2.3.7]
at com.opensymphony.xwork2.validator.DefaultValidatorFileParser.parseActionValidatorConfigs(DefaultValidatorFileParser.java:101) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(AnnotationActionValidatorManager.java:387) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildClassValidatorConfigs(AnnotationActionValidatorManager.java:272) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs(AnnotationActionValidatorManager.java:364) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:95) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:134) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:126) [:2.3.7]
at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:121) [:2.3.7]
at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:222) [:2.3.7]
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) [:2.3.7]
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:238) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:238) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) [:2.3.7]
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) [:2.3.7]
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) [:2.3.7]
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) [:2.3.7]
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:544) [:2.3.7]
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434) [:2.3.7]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
at java.lang.Thread.run(Unknown Source) [:1.6.0_20]

Can anybody suggest? what is the root cause of this stacktrace.

I've put the validation.xml under src folder(java class path) then why it is not able to get the validator.

Kindly reply.
 
Hitesh Kumar C
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys!

There was a very little mistake, i changed validations.xml to validators.xml and it starts working!

Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!