You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mbshaffer <mi...@genesyslab.com> on 2013/03/26 21:01:15 UTC

Re: deploy order

This is a good question...

What is the recommended solution?  For any web apps deployed to Tomcat that
are dependent on TomEE to be running first... how do we force it?

We found a hacker's trick, which is to create a dummy tomEE.xml file and put
it into 

C:\GCTI\Tomcat 7.0\conf\Catalina\localhost\tomEE.xml

this forces Tomcat to start tomEE first... but kind of a hack... what's the
recommendation from the experts?



--
View this message in context: http://openejb.979440.n4.nabble.com/deploy-order-tp4657241p4661808.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

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?
> >
>

RE: JNDI lookup

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
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 Romain Manni-Bucau <rm...@gmail.com>.
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>.
Why do you have a context name in dev/test but not in production?


On Fri, Mar 29, 2013 at 3:45 PM, Patel, Sanjay <Sa...@nemours.org>wrote:

> 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?
>

JNDI lookup

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
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: deploy order

Posted by mbshaffer <mi...@genesyslab.com>.
I was using the drop-in .war file.




--
View this message in context: http://openejb.979440.n4.nabble.com/deploy-order-tp4657241p4661842.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: deploy order

Posted by Romain Manni-Bucau <rm...@gmail.com>.
using tomee instead of tomee webapp?

that's one of the reason why using tomee-webapp.war is now mainly deprecated
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/28 mbshaffer <mi...@genesyslab.com>

> Unfortunately this IS a problem.  If my web app is depending on the
> additional functionality that TomEE provides, then TomEE has to be started
> first.  If I have both the tomEE.war and MyEEApplication.war in webapps
> folder, there is a race condition.   If I force tomEE to start first, it
> works fine.
>
> What is the recommended approach?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/deploy-order-tp4657241p4661840.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: deploy order

Posted by mbshaffer <mi...@genesyslab.com>.
Unfortunately this IS a problem.  If my web app is depending on the
additional functionality that TomEE provides, then TomEE has to be started
first.  If I have both the tomEE.war and MyEEApplication.war in webapps
folder, there is a race condition.   If I force tomEE to start first, it
works fine.

What is the recommended approach?



--
View this message in context: http://openejb.979440.n4.nabble.com/deploy-order-tp4657241p4661840.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: deploy order

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

In tomee you don't need it, with tomee-webapp you shouldnt expect any order
(but i think the server.xml order you be respected but that s a side effect
and not a tomcat feature)
Le 27 mars 2013 08:45, "mbshaffer" <mi...@genesyslab.com> a écrit :

> This is a good question...
>
> What is the recommended solution?  For any web apps deployed to Tomcat that
> are dependent on TomEE to be running first... how do we force it?
>
> We found a hacker's trick, which is to create a dummy tomEE.xml file and
> put
> it into
>
> C:\GCTI\Tomcat 7.0\conf\Catalina\localhost\tomEE.xml
>
> this forces Tomcat to start tomEE first... but kind of a hack... what's the
> recommendation from the experts?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/deploy-order-tp4657241p4661808.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>