Hi Gerhard,

I created an issue. My further analysis showed that this is a bug and not an 
improvement. The byte code proxy is correct. The @BeanValidation annotation is 
not marked as @Inherited and therefore 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 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üngliche Nachricht-----
Von: Gerhard Petracek [mailto:[email protected]] 
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 <[email protected]>

> Update: It works when I use the @RequestScoped Annotation from 
> javax.faces.bean instead of javax.enterprise.context. In that case 
> 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 Architect
> Fasanenweg 5, 70771 Leinfelden-Echterdingen
> +49 711 999-8704 (Tel.)
> +49 160 8224185 (Mobil)
> E-Mail: [email protected]
> Internet: http://www.t-systems.de
>
> T-Systems GEI GmbH
> Supervisory Board: Dr. Ferri Abolhassan (Chairman) Board of 
> Management: Hans-Jörg Glaß (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 
> confidential. It is intended solely for the addressee named above. Any 
> review, dissemination, or copying is strictly prohibited. If you 
> received this transmittal in error, please notify us 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üngliche Nachricht-----
> Von: Gamerdinger, Manuel
> Gesendet: Freitag, 19. Oktober 2012 12:38
> An: [email protected]
> Betreff: AW: @BeanValidation annotation at class level
>
> Hi Gerhard,
>
> thanx for quick response. I tracked down the problem that the 
> Annotation
> (@BeanValidation) is not available on objectToInspect.getClass() in 
> ExtValBeanValidationMetaDataInternals#transferGroupValidationInformationToFoundGroups.
>
> objectToInspect.getClass() returns a bytecode enhanced proxy class
> (...Dlg_$$_javassist_85) where I can see only the @RequestScoped 
> Annotation from CDI. Besides @BeanValidation also the @Named 
> Annotation from CDI is missing.
> I don't know if this behavior of a byte code proxy is correct!? I 
> would expect that at least Annotations from Retention CLASS and 
> RUNTIME are also available on the proxies.
>
> I also wonder a little why
> ExtValBeanValidationMetaDataInternals#processClass does not use the 
> classToInspect (Unproxied Class) to gather the Annotations. If this 
> method would pass classToInspect instead of objectToInspect to the 
> #transferGroupValidationInformationToFoundGroups everything should be fine.
>
> Any help with this issue is appreciated!
> Regards,
> Manuel
>
> -----Ursprüngliche Nachricht-----
> Von: Gerhard Petracek [mailto:[email protected]]
> 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 (= class level), #inspectFirstProperty, 
> #inspectBaseOfProperty (= 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 <[email protected]>
>
> > Hello MyFaces ExtVal users,
> >
> > I've a question regarding group validation together with 
> > @BeanValidation annotation. In my example the @BeanValidation 
> > annotation only works on page bean fields. On class level it seems 
> > that
> the annotation is ignored.
> >
> > This works:
> > @BeanValidation(useGroups=IUiGroupStage2.class)
> >     private String wmc;
> >
> > This doesn't work:
> > @BeanValidation(useGroups=IUiGroupStage2.class)
> > public class HomeDlg implements Serializable {
> >
> > The following documentation states that it should be possible to 
> > 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
> >
> >
>

Reply via email to