[cdi-dev] ProcessAnnotatedType question related to Seam-Config
Mark Struberg
struberg at yahoo.de
Fri Oct 14 06:52:38 EDT 2011
Hi!
Currently tracking down why seam-config sometimes does not work work OWB.
Seems that the issue is that OWB and Weld does tread AnnotatedTypes registered with BeforeBeanDiscovery in a different way.
Assume we have the following class in a BDA:
@RequestScoped
public class Doodings {
...
}
and you have a seam-beans.xml config for it too
Then seam-xml will add an AnnotatedType for it in @Observes BeforeBeanDiscovery. So far so good.
Later in the class scanning, when scanning Coodings.class, we (Apache OpenWebBeans) recognizes that the class already has a prepared AnnotatedType and use that for the system event. Apparently Weld does things different and creates a fresh AnnotatedType purely based on the native class!
That's the reason why seam-config in weld has to veto the freshly scanned type to prevent double existence of Bean<Doodings>, and in OWB this hack causes a problem...
I think there is room for improvement in the specification of AnnotatedTypes in the CDI spec ...
The behaviour must get clarified imo, wdyt?
LieGrue,
strub
More information about the cdi-dev
mailing list