You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Ka...@t-systems.com on 2008/02/26 18:48:13 UTC

Cannot find @Stateless annotation in other module

Hi,

I have a working thanks to the help of you a working test. I use TestNG now. Now I use in my bean a reference with @EJB annotation to another bean in another module. The behaviour of the detected modules when I use the include and exclude properties is strange. Also when I place an empty ejb-jar.xml in the META-INF directory it has problems to find the beans. When I go the hard way and include everything with include=.* and exclude="" I would expect that the bean must be found, but I get disappointed.
Anyway, it works somehow in the current configuration, but although the bean which should be injected in the @EJB field has a @Stateless annotation OpenEJB complains what in cannot find any @Stateless, @Stateful, ... annotation. What could be the reason?

By the way I have found differences in the behaviour between OpenJPA and Hibernate. Named native SQL queries with parameters in OpenJPA must be set by index, in Hibernate by name. Is this incompatibility intentional?

Thanks,
Karsten

Re: Cannot find @Stateless annotation in other module

Posted by David Blevins <da...@visi.com>.
On Feb 26, 2008, at 9:48 AM, <Ka...@t-systems.com> <Karsten.Ohme@t-systems.com 
 > wrote:

> Hi,
>
> I have a working thanks to the help of you a working test. I use  
> TestNG now. Now I use in my bean a reference with @EJB annotation to  
> another bean in another module. The behaviour of the detected  
> modules when I use the include and exclude properties is strange.  
> Also when I place an empty ejb-jar.xml in the META-INF directory it  
> has problems to find the beans. When I go the hard way and include  
> everything with include=.* and exclude="" I would expect that the  
> bean must be found, but I get disappointed.
> Anyway, it works somehow in the current configuration, but although  
> the bean which should be injected in the @EJB field has a @Stateless  
> annotation OpenEJB complains what in cannot find any @Stateless,  
> @Stateful, ... annotation. What could be the reason?

Jack had the same issue with @EJB references between modules.  We  
added a few features in this area just this weekend in fact.  You can  
try out the new referencing ability by updating your pom.xml to  
openejb version 3.0-SNAPSHOT and adding http://people.apache.org/repo/m2-snapshot-repository/ 
  as a snapshot enabled repository.

You definitely shouldn't get the "@Stateless, @Stateful...annotation"  
warning under normal circumstances.  Can you send the full log output?

> By the way I have found differences in the behaviour between OpenJPA  
> and Hibernate. Named native SQL queries with parameters in OpenJPA  
> must be set by index, in Hibernate by name. Is this incompatibility  
> intentional?

I don't think any incompatibility is intentional.  OpenJPA has it's  
compatibility certification and Hibernate has yet to pass the tests.   
There's no guarantee that this part is actually tested, so I couldn't  
say for sure who is doing it right.

-David