geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vamsavardhana Reddy" <c1vams...@gmail.com>
Subject Re: @EJB 3.0 injection for non-servlet components
Date Thu, 13 Nov 2008 17:44:19 GMT
Use the JNDI viewer portlet to see all the names bound to JNDI.

On Thu, Nov 13, 2008 at 11:07 PM, my_forum <my_forum@ukr.net> wrote:

>
> Guys,
> 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
> implementation)
>
> @EJB
> 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
> NamingException
>
> 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:
> http://www.nabble.com/%40EJB-3.0-injection-for-non-servlet-components-tp20484988s134p20484988.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>


-- 
Vamsi

Mime
View raw message