You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "Patel, Sanjay" <Sa...@nemours.org> on 2013/04/01 14:24:34 UTC

RE: JNDI lookup

Thanks for the hint. Would you please tell me where in web.xml can I specify module name?

-----Original Message-----
From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Sent: Saturday, March 30, 2013 4:41 AM
To: users@tomee.apache.org
Subject: Re: JNDI lookup

Think you didnt specify a module name in your web.xml Le 29 mars 2013 20:45, "Patel, Sanjay" <Sa...@nemours.org> a écrit :

> I use EJBs in my spring application.
> To inject EJB in my controller I do as below.
>
> @EJB(mappedName = "java:global/myAppName/MyBean") MyBean myBean;
>
> It works fine.
>
> Now when I deploy my application in production, It fails to find EJB.
> Because there is no context in my production environment, EJBs get 
> deployed in TomEE like "java:global//MyBean". So the spring controller 
> cannot find the EJBs.
>
> Is there any better way to inject EJBs?
>

RE: JNDI lookup

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
Thanks a lot. This worked.

-----Original Message-----
From: John D. Ament [mailto:john.d.ament@gmail.com] 
Sent: Monday, April 01, 2013 8:31 AM
To: users@tomee.apache.org
Subject: Re: JNDI lookup

It's a child to web-app in your web.xml

http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd

<module-name>bob</module-name>


On Mon, Apr 1, 2013 at 8:24 AM, Patel, Sanjay <Sa...@nemours.org>wrote:

> Thanks for the hint. Would you please tell me where in web.xml can I 
> specify module name?
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Saturday, March 30, 2013 4:41 AM
> To: users@tomee.apache.org
> Subject: Re: JNDI lookup
>
> Think you didnt specify a module name in your web.xml Le 29 mars 2013 
> 20:45, "Patel, Sanjay" <Sa...@nemours.org> a écrit :
>
> > I use EJBs in my spring application.
> > To inject EJB in my controller I do as below.
> >
> > @EJB(mappedName = "java:global/myAppName/MyBean") MyBean myBean;
> >
> > It works fine.
> >
> > Now when I deploy my application in production, It fails to find EJB.
> > Because there is no context in my production environment, EJBs get 
> > deployed in TomEE like "java:global//MyBean". So the spring 
> > controller cannot find the EJBs.
> >
> > Is there any better way to inject EJBs?
> >
>

Re: JNDI lookup

Posted by "John D. Ament" <jo...@gmail.com>.
It's a child to web-app in your web.xml

http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd

<module-name>bob</module-name>


On Mon, Apr 1, 2013 at 8:24 AM, Patel, Sanjay <Sa...@nemours.org>wrote:

> Thanks for the hint. Would you please tell me where in web.xml can I
> specify module name?
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Saturday, March 30, 2013 4:41 AM
> To: users@tomee.apache.org
> Subject: Re: JNDI lookup
>
> Think you didnt specify a module name in your web.xml Le 29 mars 2013
> 20:45, "Patel, Sanjay" <Sa...@nemours.org> a écrit :
>
> > I use EJBs in my spring application.
> > To inject EJB in my controller I do as below.
> >
> > @EJB(mappedName = "java:global/myAppName/MyBean") MyBean myBean;
> >
> > It works fine.
> >
> > Now when I deploy my application in production, It fails to find EJB.
> > Because there is no context in my production environment, EJBs get
> > deployed in TomEE like "java:global//MyBean". So the spring controller
> > cannot find the EJBs.
> >
> > Is there any better way to inject EJBs?
> >
>