4 Replies Latest reply on Sep 22, 2008 7:56 AM by Qasim Khan

    Rich ajax validator

    Qasim Khan Newbie

      Hi,

      I want to use rich ajax validator but when I perform an event on click, it gave me hibernate validate error, where as I want to use simple validation

        • 1. Re: Rich ajax validator
          Ilya Shaikovsky Master

          yes, main feature of ajax validator - is registering annotation based hibernate validators.

          • 2. Re: Rich ajax validator
            Qasim Khan Newbie

            but in live demo they also used it without hibernate validation and thats what I want to implement.

            and I got the following exceptions

            SEVERE: Exception in the filter chain
            javax.servlet.ServletException: Servlet execution threw an exception
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
             at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
             at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
             at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator
             at org.richfaces.validator.BeanValidator.createValidator(BeanValidator.java:283)
             at org.richfaces.validator.BeanValidator.getValidator(BeanValidator.java:249)
             at org.richfaces.validator.BeanValidator.validateClass(BeanValidator.java:229)
             at org.richfaces.validator.BeanValidator.validateBean(BeanValidator.java:214)
             at org.richfaces.validator.BeanValidator.validate(BeanValidator.java:163)
             at org.richfaces.validator.BeanValidator$ValidationResolver.setValue(BeanValidator.java:395)
             at org.apache.el.parser.AstValue.setValue(AstValue.java:143)
             at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
             at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
             at org.richfaces.validator.BeanValidator.validate(BeanValidator.java:119)
             at org.richfaces.validator.FacesBeanValidator.validate(FacesBeanValidator.java:79)
             at javax.faces.component.UIInput.validateValue(UIInput.java:1019)
             at javax.faces.component.UIInput.validate(UIInput.java:875)
             at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
             at javax.faces.component.UIInput.processValidators(UIInput.java:672)
             at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
             at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:24)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:242)
             at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
             at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
             at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             ... 17 more
            Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
             at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
             ... 49 more
            Sep 22, 2008 5:04:01 AM org.apache.catalina.core.StandardWrapperValve invoke
            SEVERE: Servlet.service() for servlet Faces Servlet threw exception
            java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
             at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
             at org.richfaces.validator.BeanValidator.createValidator(BeanValidator.java:283)
             at org.richfaces.validator.BeanValidator.getValidator(BeanValidator.java:249)
             at org.richfaces.validator.BeanValidator.validateClass(BeanValidator.java:229)
             at org.richfaces.validator.BeanValidator.validateBean(BeanValidator.java:214)
             at org.richfaces.validator.BeanValidator.validate(BeanValidator.java:163)
             at org.richfaces.validator.BeanValidator$ValidationResolver.setValue(BeanValidator.java:395)
             at org.apache.el.parser.AstValue.setValue(AstValue.java:143)
             at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
             at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
             at org.richfaces.validator.BeanValidator.validate(BeanValidator.java:119)
             at org.richfaces.validator.FacesBeanValidator.validate(FacesBeanValidator.java:79)
             at javax.faces.component.UIInput.validateValue(UIInput.java:1019)
             at javax.faces.component.UIInput.validate(UIInput.java:875)
             at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
             at javax.faces.component.UIInput.processValidators(UIInput.java:672)
             at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
             at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:24)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
             at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
             at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:242)
             at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
             at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
             at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
             at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
             at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
             at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
             at java.lang.Thread.run(Thread.java:619)
            


            I downloaded the live demo ready to deolpy war and they are not using hibernate validation too, so what would be the problem

            • 3. Re: Rich ajax validator
              Ilya Shaikovsky Master

              In livedemo simple example without hibernate validation - there just no annotations in the backing bean. But ajaxValidator trying to create such validator in any way. So you need the hibernate validation libraries in any way.

              • 4. Re: Rich ajax validator
                Qasim Khan Newbie

                thanks, it works