openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: tomee ejb annotation not injecting
Date Thu, 09 Aug 2012 06:14:59 GMT
Hi,

It was fixed on the snapshot a week after the release i think.

Can you give it a try with the snapshot please?

- Romain
Le 9 août 2012 08:13, "Louis Bros" <louisbrosnan@hotmail.com> a écrit :

> tomee ejb annotation not injecting
>
> Hi everyone,
>
> I'm having problems with EJB injection is tomee. I can't seem to find what
> I'm missing.
>
> I have a simple JSF webapp with both my ManagedBean and Stateless Bean in
> the same war file under WEB-INF/classes.
>
> The webapp works as expected when run in Glassfish 3 but in tomee the
> injection seems to fail.
>
> I hope someone knows what I'm doing wrong.
>
>
> My EJB:
>
> package com.ejbtest.ejb;
>
> import javax.ejb.Stateless;
>
> @Stateless
> public class HelloEJB{
>
>         public String sayHello(){
>                 return "Hey hey";
>         }
> }
>
>
> My Managed Bean:
>
> package com.ejbtest.test;
>
> import javax.faces.bean.ManagedBean;
> import javax.faces.bean.RequestScoped;
> import java.io.Serializable;
>
> import javax.ejb.EJB;
> import com.ejbtest.ejb.HelloEJB;
>
> @ManagedBean
> @RequestScoped
> public class TestBean implements Serializable{
>
>         @EJB
>         private HelloEJB helloEJB;
>
>         private String test = "default";
>
>         public String getTest() {
>                 return test;
>         }
>
>         public void setTest(String test){
>                 this.test = test;
>         }
>
>         public String doTest(){
>
>                 if(helloEJB == null){
>                         test = "Not Injected";
>                 }
>                 else{
>                         test = helloEJB.sayHello();
>                 }
>                 return null;
>         }
> }
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/tomee-ejb-annotation-not-injecting-tp4656726.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message