tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karsten Ohme <widerst...@t-online.de>
Subject Re: Stateless inheritited bean is not found when Interface is not specified
Date Fri, 14 Mar 2008 23:29:54 GMT
David Blevins schrieb:
> On Mar 13, 2008, at 10:41 AM, <Karsten.Ohme@t-systems.com> 
> <Karsten.Ohme@t-systems.com> wrote:
> 
>>
>> Hello,
>>
>> NetworkStorageServiceImpl is a Stateless Local Bean. 
>> AsyncNetworkStorageServiceImpl also, but extends this bean.
>>
>> When I do this:
>>
>> public class AsyncNetworkStorageServiceImpl extends 
>> NetworkStorageServiceImpl
>>
>> the bean is not found.
> 
> This one is intentional.  If you want it to be a bean you have to use an 
> @Stateless annotation on the class or declare it in xml.
> 
> Section 4.6.2. of EJB 3.0 Core states: "A session bean class must not 
> have a superclass that is itself a session bean class."
> 
> The wording is terrible and we are fixing it in the EJB 3.1 spec.  The 
> intended meaning is that you cannot inherit the act of being a bean.

No, thats clear. The AsyncNetworkStorageServiceImpl has also the 
@Stateless Annotation, but is not found. Only if I implement the 
interface again which should actually be inherited from the parent 
class, the bean is found. I dont' know why I have to implement the 
interface again. The Interface does not contain any annotation.

E.g.:

Interface Foo

@Stateless(name="Foo")
Class FooImpl implements Foo

@Stateless(name="Bar")
Class BarImpl extends FooImpl

The BarImpl is not published in JNDI.

Karsten

> 
>> When I also specify the interface:
>>
>> public class AsyncNetworkStorageServiceImpl extends 
>> NetworkStorageServiceImpl implements NetworkStorageService
>>
>> it works and the following entry is shown:
>>
>> INFO - Jndi(name=AsyncNetworkStorageServiceImplLocal) --> 
>> Ejb(deployment-id=Asyn
>> cNetworkStorageServiceImpl)
> 
> I assume you mean that the interface from the super class is not found 
> unless explicitly declared in the child class.  That is not 
> intentional.  I'll make sure that's fixed for the 3.0 final.
> 
> -David
> 
> 
> 
> 


Mime
View raw message