Closed
Description
Andy Wilkinson opened SPR-15807 and commented
This problem was originally reported in #20188 and marked as fixed in 4.3.9. However, the problem still occurs with both 4.3.9 and 4.3.10. It can be reproduced using the sample from #20188. The failure is, I believe, unchanged from when the problem was originally reported against 4.3.8.
For reference here's the failure with 4.3.9:
Exception in thread "main" java.lang.AbstractMethodError: org.springframework.validation.beanvalidation.CustomValidatorBean.forExecutables()Ljavax/validation/executable/ExecutableValidator;
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy9.forExecutables(Unknown Source)
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.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:201)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.example.LazyValidatorProblem$SampleService$$EnhancerBySpringCGLIB$$bcae8912.doSomething(<generated>)
at com.example.LazyValidatorProblem.main(LazyValidatorProblem.java:62)
And with 4.3.10:
Exception in thread "main" java.lang.AbstractMethodError: org.springframework.validation.beanvalidation.CustomValidatorBean.forExecutables()Ljavax/validation/executable/ExecutableValidator;
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy9.forExecutables(Unknown Source)
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.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:201)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.example.LazyValidatorProblem$SampleService$$EnhancerBySpringCGLIB$$bcae8912.doSomething(<generated>)
at com.example.LazyValidatorProblem.main(LazyValidatorProblem.java:61)
Affects: 4.3.9, 4.3.10
Reference URL: spring-projects/spring-boot#9416
Issue Links:
- AbstractMethodError when calling validated method of MethodValidationPostProcessor is using a @Lazy validator [SPR-15629] #20188 AbstractMethodError when calling validated method of MethodValidationPostProcessor is using a
@Lazy
validator - Unable to use Hibernate Validator 4.3.2 if Bean Validation API 1.1 is on the classpath [SPR-15856] #20411 Unable to use Hibernate Validator 4.3.2 if Bean Validation API 1.1 is on the classpath