Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D608EDB9F for ; Fri, 19 Oct 2012 15:32:24 +0000 (UTC) Received: (qmail 33269 invoked by uid 500); 19 Oct 2012 15:32:24 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 33221 invoked by uid 500); 19 Oct 2012 15:32:23 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 33207 invoked by uid 99); 19 Oct 2012 15:32:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 15:32:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.25.30.7] (HELO tcmail33.telekom.de) (194.25.30.7) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 15:32:18 +0000 Received: from he113497.emea1.cds.t-internal.com ([10.206.92.154]) by tcmail31.telekom.de with ESMTP/TLS/AES128-SHA; 19 Oct 2012 17:31:54 +0200 Received: from HE111490.emea1.cds.t-internal.com ([10.206.92.87]) by HE113497.emea1.cds.t-internal.com ([::1]) with mapi; Fri, 19 Oct 2012 17:31:52 +0200 From: To: Date: Fri, 19 Oct 2012 17:31:51 +0200 Subject: AW: @BeanValidation annotation at class level Thread-Topic: @BeanValidation annotation at class level Thread-Index: Ac2uC6M4jC8jB+T6SiGM3wilS/Yu2wAAGBLQ Message-ID: <3B8CC2E826F6B844B471DC3DF590CB45EEC596970F@HE111490.emea1.cds.t-internal.com> References: <3B8CC2E826F6B844B471DC3DF590CB45EEC58C41BB@HE111490.emea1.cds.t-internal.com> <3B8CC2E826F6B844B471DC3DF590CB45EEC596952D@HE111490.emea1.cds.t-internal.com> <3B8CC2E826F6B844B471DC3DF590CB45EEC5969566@HE111490.emea1.cds.t-internal.com> <3B8CC2E826F6B844B471DC3DF590CB45EEC5969671@HE111490.emea1.cds.t-internal.com> <3B8CC2E826F6B844B471DC3DF590CB45EEC59696B7@HE111490.emea1.cds.t-internal.com> In-Reply-To: Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Gerhard, ProxyUtils.getUnproxiedClass(objectToInspect.getClass()) works fine in my c= ase. But I think the bug is exactly in this while loop. In this loop always= the objectToInspect is passed to the #transferGroupValidationInformationTo= FoundGroups. A second iteration will result in same result as objectToInspe= ct is not changed in the loop. From my point of view the classToInspect sho= uld be passed the #transferGroupValidationInformationToFoundGroups.=20 while (!Object.class.getName().equals(classToInspect.getName())) { transferGroupValidationInformationToFoundGroups(objectToInspect= , foundGroupsForPropertyValidation, restrictedGroupsForPropertyValidation, modelValidationEntryList, restrictedGroupsForModelValidation, activeViewId, processModelValidation); processInterfaces(objectToInspect.getClass(), objectToInspect, foundGroupsForPropertyValidation, restrictedGroupsForPropertyValidation, modelValidationEntryList, restrictedGroupsForModelValidation, activeViewId, processModelValidation); classToInspect =3D classToInspect.getSuperclass(); } Regards, Manuel -----Urspr=FCngliche Nachricht----- Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com]=20 Gesendet: Freitag, 19. Oktober 2012 17:08 An: MyFaces Discussion Betreff: Re: @BeanValidation annotation at class level hi manuel, ok - i just know that weld changed something in that area. we tested the DefaultProxyHelper with owb, but maybe websphere uses somethi= ng special here. see: Class classToInspect =3D ProxyUtils.getUnproxiedClass(objectToInspect.getClass()); in #processClass to customize it, you can provide a custom implementation of org.apache.myfa= ces.extensions.validator.core.proxy.ProxyHelper (also see e.g. DefaultExtValCoreConfiguration#proxyHelper) however, you should get the real class in the next iteration (see #getSuper= class in #processClass) in any case. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/10/19 > Hi Gerhard, > > no, we're using the standard WebSphere 8.0 stack which uses=20 > OpenWebBeans 1.1.0. > Anyways can you give me more information about the ProxyHelper? > > Regards, > Manuel > > > -----Urspr=FCngliche Nachricht----- > Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] > Gesendet: Freitag, 19. Oktober 2012 16:01 > An: MyFaces Discussion > Betreff: Re: @BeanValidation annotation at class level > > hi manuel, > > i guess - you are using weld... > you can register a custom ProxyHelper to get rid of the issue. > > regards, > gerhard > > http://www.irian.at > > Your JSF/JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > > > 2012/10/19 > > > Hi Gerhard, > > > > I created an issue. My further analysis showed that this is a bug=20 > > and not an improvement. The byte code proxy is correct. The=20 > > @BeanValidation annotation is not marked as @Inherited and therefore=20 > > not populated to its subclasses. But the proxy is a subclass. > > So for me there are 2 possibilities to correct: > > 1) Make the Annotation inherited. But I think that would validate=20 > > ExtVal's concept of additive groups within a class hierarchy. > > 2) The suggested solution from my mail before. > > > > It would be great if we could get a patch soon! > > Thanx, > > Manuel > > > > > > > > -----Urspr=FCngliche Nachricht----- > > Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] > > Gesendet: Freitag, 19. Oktober 2012 13:19 > > An: MyFaces Discussion > > Betreff: Re: @BeanValidation annotation at class level > > > > hi manuel, > > > > thx for providing the details. > > please file a jira ticket (improvement) for it at [1]. > > > > regards, > > gerhard > > > > [1] https://issues.apache.org/jira/browse/EXTVAL > > > > http://www.irian.at > > > > Your JSF/JavaEE powerhouse - > > JavaEE Consulting, Development and > > Courses in English and German > > > > Professional Support for Apache MyFaces > > > > > > > > 2012/10/19 > > > > > Update: It works when I use the @RequestScoped Annotation from=20 > > > javax.faces.bean instead of javax.enterprise.context. In that case=20 > > > there is no byte code proxy returned (objectToInspect.getClass()). > > > But anyways I expect that it should also run with the CDI scopes. > > > > > > Manuel Gamerdinger > > > > > > T-Systems GEI GmbH > > > Systems Integration > > > Industry Application Solutions > > > Project Center Industry Applications Manuel Gamerdinger Software=20 > > > Architect Fasanenweg 5, 70771 Leinfelden-Echterdingen > > > +49 711 999-8704 (Tel.) > > > +49 160 8224185 (Mobil) > > > E-Mail: manuel.gamerdinger@t-systems.com > > > Internet: http://www.t-systems.de > > > > > > T-Systems GEI GmbH > > > Supervisory Board: Dr. Ferri Abolhassan (Chairman) Board of > > > Management: Hans-J=F6rg Gla=DF (Chairman), Jan Krellner Commercial > > > register: Amtsgericht Aachen HRB 7106 Registered office: Aachen Int. > > > VAT No. DE 811 137 130 > > > > > > Notice: This transmittal and/or attachments may be privileged or=20 > > > confidential. It is intended solely for the addressee named above. > > > Any review, dissemination, or copying is strictly prohibited. If=20 > > > you received this transmittal in error, please notify us=20 > > > immediately by reply and immediately delete this message and all its = attachments. > > > Thank > > you. > > > > > > Big changes start small - conserve resources by not printing every > > e-mail. > > > > > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: Gamerdinger, Manuel > > > Gesendet: Freitag, 19. Oktober 2012 12:38 > > > An: users@myfaces.apache.org > > > Betreff: AW: @BeanValidation annotation at class level > > > > > > Hi Gerhard, > > > > > > thanx for quick response. I tracked down the problem that the=20 > > > Annotation > > > (@BeanValidation) is not available on objectToInspect.getClass()=20 > > > in > > > > > > ExtValBeanValidationMetaDataInternals#transferGroupValidationInformationT= oFoundGroups. > > > > > > objectToInspect.getClass() returns a bytecode enhanced proxy class > > > (...Dlg_$$_javassist_85) where I can see only the @RequestScoped=20 > > > Annotation from CDI. Besides @BeanValidation also the @Named=20 > > > Annotation from CDI is missing. > > > I don't know if this behavior of a byte code proxy is correct!? I=20 > > > would expect that at least Annotations from Retention CLASS and=20 > > > RUNTIME are also available on the proxies. > > > > > > I also wonder a little why > > > ExtValBeanValidationMetaDataInternals#processClass does not use=20 > > > the classToInspect (Unproxied Class) to gather the Annotations. If=20 > > > this method would pass classToInspect instead of objectToInspect=20 > > > to the #transferGroupValidationInformationToFoundGroups everything=20 > > > should be > > fine. > > > > > > Any help with this issue is appreciated! > > > Regards, > > > Manuel > > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] > > > Gesendet: Donnerstag, 18. Oktober 2012 21:49 > > > An: MyFaces Discussion > > > Betreff: Re: @BeanValidation annotation at class level > > > > > > hi manuel, > > > > > > you can check it in ExtValBeanValidationMetaDataInternals# > > > extractExtValBeanValidationMetaData > > > (see #inspectFirstBean (=3D class level), #inspectFirstProperty,=20 > > > #inspectBaseOfProperty (=3D class level) and #inspectLastProperty) > > > > > > regards, > > > gerhard > > > > > > http://www.irian.at > > > > > > Your JSF/JavaEE powerhouse - > > > JavaEE Consulting, Development and Courses in English and German > > > > > > Professional Support for Apache MyFaces > > > > > > > > > > > > 2012/10/18 > > > > > > > Hello MyFaces ExtVal users, > > > > > > > > I've a question regarding group validation together with=20 > > > > @BeanValidation annotation. In my example the @BeanValidation=20 > > > > annotation only works on page bean fields. On class level it=20 > > > > seems that > > > the annotation is ignored. > > > > > > > > This works: > > > > @BeanValidation(useGroups=3DIUiGroupStage2.class) > > > > private String wmc; > > > > > > > > This doesn't work: > > > > @BeanValidation(useGroups=3DIUiGroupStage2.class) > > > > public class HomeDlg implements Serializable { > > > > > > > > The following documentation states that it should be possible to=20 > > > > declare the annotation at class level: > > > > http://wiki.apache.org/myfaces/Extensions/Validator/DevDoc > > > > But now how can I make it run? Is there some configuration to be > done? > > > > > > > > Thanx in advance! > > > > Manuel > > > > > > > > > > > > > >