java - javax.validation.ValidationException: Type interface org.hibernate.validator.method.MethodValidator not supported -
am using spring 3.1 , hibernate validator 4.2. have custom traversal resolver , registered spring bean after have create vlaidaton factory using below code
<bean id="validatorfactory" class="org.springframework.validation.beanvalidation.localvalidatorfactorybean" > <property name="traversableresolver" ref="traversableresolver"/> <property name="validationpropertymap"> <util:map> <entry key="hibernate.validator.fail_fast" value="false" /> </util:map> </property> </bean> <bean id="traversableresolver" class="org.hibernate.validator.engine.resolver.singlethreadcachedtraversableresolver" > <constructor-arg ref="delegate"/> </bean> <bean id="methodvalidatoradvice" class="common.validator.methodvalidationaspect"> <constructor-arg ref="validatorfactory"/> </bean>
when spring try initialize methodvalidatonaspect implment methodvalidationinterceptor, got below expceiton javax.validation.validationexception: type interface org.hibernate.validator.method.methodvalidator not supported
added log entry caused by: javax.validation.validationexception: type interface org.hibernate.validator.method.methodvalidator not supported
at org.hibernate.validator.engine.validatorimpl.unwrap(validatorimpl.java:263) @ org.springframework.validation.beanvalidation.methodvalidationinterceptor.<init>(methodvalidationinterceptor.java:82) @ com.cisco.sdp.core.common.validator.methodvalidationaspect.<init>(methodvalidationaspect.java:31) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:526) @ org.springframework.beans.beanutils.instantiateclass(beanutils.java:147) @ org.springframework.beans.factory.support.simpleinstantiationstrategy.instantiate(simpleinstantiationstrategy.java:110) @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:280) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.autowireconstructor(abstractautowirecapablebeanfactory.java:1035) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:939) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:485) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:456) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:294) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:225) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:291) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:193) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:609) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:918) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:469) @ com.cisco.sdp.spring.core.sdpclasspathapplicationcontext.<init>(sdpclasspathapplicationcontext.java:52) @ com.cisco.sdp.spring.core.sdpclasspathapplicationcontext.<init>(sdpclasspathapplicationcontext.java:63) @ com.cisco.sdp.spring.core.sdpclasspathapplicationcontext.<init>(sdpclasspathapplicationcontext.java:57) @ com.cisco.sdp.spring.core.sdpclasspathapplicationcontext.<init>(sdpclasspathapplicationcontext.java:73) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:526) @ org.springframework.beans.beanutils.instantiateclass(beanutils.java:147) @ org.springframework.beans.factory.support.simpleinstantiationstrategy.instantiate(simpleinstantiationstrategy.java:110) @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:280) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.autowireconstructor(abstractautowirecapablebeanfactory.java:1035) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:939) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:485) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:456) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:294) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:225) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:291) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:193) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:609) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:918) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:469) @ org.springframework.context.access.contextsingletonbeanfactorylocator.initializedefinition(contextsingletonbeanfactorylocator.java:143) @ org.springframework.beans.factory.access.singletonbeanfactorylocator.usebeanfactory(singletonbeanfactorylocator.java:381) @ org.springframework.web.context.contextloader.loadparentcontext(contextloader.java:528) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:374) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:283) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:111) @ weblogic.servlet.internal.eventsmanager$firecontextlisteneraction.run(eventsmanager.java:678) @ weblogic.security.acl.internal.authenticatedsubject.doas(authenticatedsubject.java:321) @ weblogic.security.service.securitymanager.runas(securitymanager.java:120) @ weblogic.servlet.provider.wlssubjecthandle.run(wlssubjecthandle.java:57) @ weblogic.servlet.internal.eventsmanager.executecontextlistener(eventsmanager.java:243) @ weblogic.servlet.internal.eventsmanager.notifycontextcreatedevent(eventsmanager.java:200) @ weblogic.servlet.internal.eventsmanager.notifycontextcreatedevent(eventsmanager.java:185) @ weblogic.servlet.internal.webappservletcontext.preloadresources(webappservletcontext.java:1838) @ weblogic.servlet.internal.webappservletcontext.start(webappservletcontext.java:2876) @ weblogic.servlet.internal.webappmodule.startcontexts(webappmodule.java:1661) @ weblogic.servlet.internal.webappmodule.start(webappmodule.java:823) @ weblogic.application.internal.extensiblemodulewrapper$startstatechange.next(extensiblemodulewrapper.java:360) @ weblogic.application.internal.extensiblemodulewrapper$startstatechange.next(extensiblemodulewrapper.java:356) @ weblogic.application.utils.statemachinedriver.nextstate(statemachinedriver.java:42) @ weblogic.application.internal.extensiblemodulewrapper.start(extensiblemodulewrapper.java:138)
i got same problem, fixed when put jboss-logging-3.1.0.ga.jar class path. don't know why.
<dependency> <groupid>org.jboss.logging</groupid> <artifactid>jboss-logging</artifactid> <version>3.1.0.ga</version> </dependency>
if problem still annoying you, try these dependencies.
<dependency> <groupid>javax.el</groupid> <artifactid>javax.el-api</artifactid> <version>3.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.glassfish.web</groupid> <artifactid>javax.el</artifactid> <version>2.2.6</version> </dependency>
Comments
Post a Comment