bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BVAL-137) Apache Bean Validation fails on CDI proxies, when intergrated with Weld CDI 1.2
Date Wed, 10 Jun 2015 21:02:00 GMT

    [ https://issues.apache.org/jira/browse/BVAL-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581077#comment-14581077
] 

Romain Manni-Bucau commented on BVAL-137:
-----------------------------------------

Hi

do you want to have a try fixing it (ie providing us a patch?). The place to enhance is http://svn.apache.org/repos/asf/bval/trunk/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java
and importing WeldProxyFilter() logic should be fine

> Apache Bean Validation fails on CDI proxies, when intergrated with Weld CDI 1.2
> -------------------------------------------------------------------------------
>
>                 Key: BVAL-137
>                 URL: https://issues.apache.org/jira/browse/BVAL-137
>             Project: BVal
>          Issue Type: Bug
>          Components: method validation
>    Affects Versions: 1.1.0
>         Environment: Apache Bean Validation 1.1 and Weld CDI 1.2.
>            Reporter: Nathan Mittlestat
>
> When running the Bean Validation TCK using Apache Bean Validation and Weld 1.2 as the
CDI implementation the following exception occurs.
> javax.validation.ConstraintDeclarationException: @Valid on returned value can't be set
more than once
>         at org.apache.bval.jsr.BeanDescriptorImpl$ExecutableMeta.buildMethodConstraints(BeanDescriptorImpl.java:601)
>         at org.apache.bval.jsr.BeanDescriptorImpl$ExecutableMeta.buildExecutableDescriptors(BeanDescriptorImpl.java:853)
>         at org.apache.bval.jsr.BeanDescriptorImpl$ExecutableMeta.<init>(BeanDescriptorImpl.java:334)
>         at org.apache.bval.jsr.BeanDescriptorImpl$ExecutableMeta.<init>(BeanDescriptorImpl.java:321)
>         at org.apache.bval.jsr.BeanDescriptorImpl.<init>(BeanDescriptorImpl.java:110)
>         at org.apache.bval.jsr.ClassValidator.createBeanDescriptor(ClassValidator.java:674)
>         at org.apache.bval.jsr.ClassValidator.getConstraintsForClass(ClassValidator.java:266)
>         at org.apache.bval.jsr.ClassValidator.validateBean(ClassValidator.java:450)
>         at org.apache.bval.jsr.ClassValidator.validateBeanNet(ClassValidator.java:409)
>         at org.apache.bval.jsr.ClassValidator$JsrValidationCallback.validate(ClassValidator.java:1116)
>         at org.apache.bval.util.ValidationHelper.validateBeanInContext(ValidationHelper.java:88)
>         at org.apache.bval.util.ValidationHelper.validateContext(ValidationHelper.java:70)
>         at org.apache.bval.jsr.ClassValidator.validateInvocationParameters(ClassValidator.java:867)
>         at org.apache.bval.jsr.ClassValidator.validateParameters(ClassValidator.java:1046)
>         at org.apache.bval.cdi.BValInterceptor.invoke(BValInterceptor.java:132)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
>         at java.lang.reflect.Method.invoke(Method.java:620)
>         at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
>         at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
>         at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
>         at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
>         at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
>         at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
>         at org.hibernate.beanvalidation.tck.tests.integration.cdi.executable.CalendarServiceWithCascadingReturnValue$Proxy$_$$_WeldSubclass.createValidEvent(Unknown
Source)
>         at org.hibernate.beanvalidation.tck.tests.integration.cdi.executable.ExecutableValidationTest.testCascadedReturnValueValidationOfConstrainedMethod(ExecutableValidationTest.java:152)
> This exception is due to the Weld proxy duplicating the annotations from the class being
proxied.  The issue has been brought up in both the Weld community and the Bean Validation
TCK community.  The response from both communities has been to implement Weld specific code
to handle the proxies as a special case.
> Please see the recommendation here:
> https://hibernate.atlassian.net/browse/BVTCK-69?filter=-2



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message