[cdi-dev] Session Bean business interface inheritance
Martin Kouba
mkouba at redhat.com
Tue Jun 5 11:50:48 EDT 2012
Hi,
recently we had an issue with regard to Session Bean business interface inheritance when running CDI TCK 1.0.4.SP3 on GlassFish - see also WELD-1133 [1]. The following discussion revealed possible specification conflict (EJB 3.1 vs CDI 1.0). Pete Muir asked me to write some brief summary. So here it is :-)
The problem: it seems that session bean business interface inheritance is not allowed in EJB 3.1
(4.9.2.1 Session Bean Superclasses)
Let's assume this code:
@Local
interface Bar {}
@Local
interface Foo extends Bar {
}
@Stateless
class FooBean implements Foo {
}
According to the spec (EJB 3.1) the set of exposed client views of FooBean should only be Foo. Not Foo and Bar.
However the CDI spec defines bean types for a session bean in a following way: "The unrestricted set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces" (3.2.2. Bean types of a session bean).
Note that some EJB implementations DO support this kind of inheritance out of the box (e.g. JBoss AS 7 EJB module).
Martin
[1]
https://issues.jboss.org/browse/WELD-1133
--
Martin Kouba
JBoss Quality Assurance Engineer
E-mail: mkouba at redhat.com
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
More information about the cdi-dev
mailing list