We use javax validation for validating out data objects.Some case we might get an error like unable to find default provider. This error is due to old version of hibernate jar is referred in class-path.
Even though if we did not specify the validation libraries it will take from default hibernate libs. This issue can be avoid by using correct libraries.
By adding below maven dependencies in your pom.xml will resolve the above mentioned issue.
Even though if we did not specify the validation libraries it will take from default hibernate libs. This issue can be avoid by using correct libraries.
javax.validation.ValidationException: Unable to find a default provider at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264) at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111) at com.pamp.validation.BookingValidator.validate(BookingValidator.java:17) at com.pamp.controllers.FindurBookingService.bookDeal(FindurBookingService.java:21) at com.pamp.controllers.IndexBean.bookDeal(IndexBean.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.el.parser.AstValue.invoke(AstValue.java:245) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:277) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) at javax.faces.component.UICommand.broadcast(UICommand.java:300) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
By adding below maven dependencies in your pom.xml will resolve the above mentioned issue.
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator-annotation-processor</artifactId> <version>4.2.0.FINAL</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.FINAL</version> </dependency>
0 Comments
Post a Comment