geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From my_forum <>
Subject @EJB 3.0 injection for non-servlet components
Date Thu, 13 Nov 2008 17:37:47 GMT

Probably this does not relate to Geronimo itself, but to OpenEjb but this
problem should be common for everybody who uses EJB 3.0 in Geronimo.
So the questions is as follows:
When I make the injection (StatesDAO is interface, StatesDAOBean is an

private StatesDAO statesDAO;

in the class that extends HttpServlet the injection works file, but when I'm
trying  to use the same code in my test methods (they are in the Servlet
Container) or in Struts Actions, the injection does not work not work.

As a solution I tried to look up it by JNDI name but Always got

new InitialContext().lookup("java:comp/env/StatesDAO")
new InitialContext().lookup("java:comp/env/StatesDAOBean")
new InitialContext().lookup("java:comp/env/myPackage.StatesDAO")
new InitialContext().lookup("java:comp/env/myPackage.StatesDAOBean")

Nothing works.

So the second question is what is a correct JNDI name for my Bean?
openejb-jar.xml does not contain any specific data, so the default JNDI
names are used.

Thanks in advance!

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message