Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-18 Thread Jean-Louis MONTEIRO
+1 2012/2/17 Romain Manni-Bucau rmannibu...@gmail.com Beta 2 is gold, next will be diamond ;) Le 17 févr. 2012 19:09, David Blevins david.blev...@gmail.com a écrit : On Feb 17, 2012, at 5:08 AM, afryer wrote: Just upgraded to beta-2 and now @ManagedBean works. I had to change the

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread afryer
I didn't know about the @ManagedBean annotation. I got it to work using the @LocalClient annotation and creating an empty META-INF/application-client.xml file. What's the difference between @ManagedBean and @LocalClient? I just tried using @ManagedBean but i still got the same error as before

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread Romain Manni-Bucau
localclient or managedbean should do about the same, which managedbean annotation did you use i think javaee-api contain different version (multiple package). @Inject should work too. You can Simply close your container by test class ; typically you start it in BeforClass in each test class and

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread afryer
I'm using openejb-core 4.0.0-beta-1 for my test cases. I was using @javax.annotation.ManagedBean but i haven't managed to get it to work yet. I'll keep trying tomorrow though. I was aware that creating and destroying an EJBContainer per test case removed the need for any annotations such as

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread Romain Manni-Bucau
hmm, maybe you should update to beta-2, we did a lot of fix about cdi. if you want fast test maybe you should have a look to ApplicationComposer. - Romain 2012/2/17 afryer apfr...@hotmail.com I'm using openejb-core 4.0.0-beta-1 for my test cases. I was using @javax.annotation.ManagedBean

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread David Blevins
On Feb 17, 2012, at 5:08 AM, afryer wrote: Just upgraded to beta-2 and now @ManagedBean works. I had to change the context I was binding to, to get this to work. Using @LocalClient i had to bind using this code... Using @ManagedBean i have to bind like this... That difference

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-17 Thread Romain Manni-Bucau
Beta 2 is gold, next will be diamond ;) Le 17 févr. 2012 19:09, David Blevins david.blev...@gmail.com a écrit : On Feb 17, 2012, at 5:08 AM, afryer wrote: Just upgraded to beta-2 and now @ManagedBean works. I had to change the context I was binding to, to get this to work. Using

Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-16 Thread afryer
I am writing unit test cases for a group of stateless session ejbs and to speed up test case execution, I want to create the embedded ejb container once and use it across all the test case classes. An example of my test case structure is shown below. Assuming MyFirstTest runs first, then the

Re: Injection fails in any class that didn't instantiate an embedded ejb container

2012-02-16 Thread Romain Manni-Bucau
Hi, You can either add an annotation to make it managed (managedbean one for instance) or use openejb.additionnal.callers property to specify the qualified name of the test class in the map you give when you start the container. The reason it doesnt work is you dont start the container in the