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 > Beta 2 is gold, next will be diamond ;) > > Le 17 févr. 2012 19:09, "David Blevins" 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

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" 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 @LocalClient i

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

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

2012-02-17 Thread afryer
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 doesn't bother me at all. Just putting it here for refer

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 > I'm using openejb-core 4.0.0-beta-1 for my test cases. > > I was using @javax.annotation.ManagedBean but i haven't man

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 @Man

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 c

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 (co

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

2012-02-16 Thread David Blevins
There's a little bit of magic we have to see who called the EJBContainer and add that class to the application as a @ManagedBean. Not really magic actually -- we create an exception and then trim the call stack. The alternative is to simply add @javax.annotation.ManagedBean to your test classe

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 tes

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 in