-
1. Re: Using a stateless bean outside a seam application
christian.bauer Apr 30, 2007 7:54 AM (in response to gunnarif)EJBs can't be in WARs, they need to be in JAR that is wrapped in an EAR (yes, it's stupid). Other than that, you can call an EJB just as usual but you won't get Seam interception and no @In will happen when you call a method.
-
2. Re: Using a stateless bean outside a seam application
christian.bauer Apr 30, 2007 7:55 AM (in response to gunnarif)Note that EJB 3.0 beans are plain Java classes. So you can always and anywhere access that class and instantiate it. You won't get any EJB service then though, no transaction interception etc.
-
3. Re: Using a stateless bean outside a seam application
gunnarif Apr 30, 2007 9:07 AM (in response to gunnarif)Thanks a million!
But if I deploy the EAR file and then the WAR file (not in the EAR) could I do something like this in the WAR?:public class SomePOJO { @EJB ProductManager productManager; ...... }
Or somehow share the stateless context between theses applications (or modules)?
Sorry for my ignorance, I'm new to this J2EE and SEAM. -
4. Re: Using a stateless bean outside a seam application
christian.bauer Apr 30, 2007 10:18 AM (in response to gunnarif)In JBoss 5.0, maybe. The @EJB would be a Java EE 5.0 (Servlet 2.5, Tomcat 6) shortcut for a remoate EJB JNDI lookup.
-
5. Re: Using a stateless bean outside a seam application
christian.bauer Apr 30, 2007 10:22 AM (in response to gunnarif)What I said earlier wasn't entirely correct: You can get a handle on an EJB as usual, and Seam interception when you call a method _will happen_. However, if the Seam contexts are not present on the virtual machine in which this EJB runs (which would need a JSF request so that the phase listener runs and sets up the contexts), it won't work. This is the same issue we are currently trying to solve with webservice calls, so check the support for that in CVS code (I haven't).