Hows does Seam injection work in Ejb3

Posted by kazanaki on Stack Overflow See other posts from Stack Overflow or by kazanaki
Published on 2010-04-12T08:36:27Z Indexed on 2010/04/12 12:53 UTC
Read the original article Hit count: 667

Filed under:
|
|
|
|

Hello

We are using

  • Seam 2.2.0
  • Java 1.6.14
  • Weblogic 10.3.1.0 (named 11g Doh!)

I have looked at

However I still do not understand how to inject an EJB3 bean into a JSF backing bean. It seems to me that I have to (correct me if I am wrong)

  1. Annotate with @Name my backing bean
  2. Annotate with @Name my EJB3 bean
  3. Use the @In annotation in the backing bean
  4. Put an empty seam.properties file in the WAR that contains the backing bean
  5. Put an empty seam.properties file in the JAR that contains the EJB
  6. Set up a Seam interceptor in ejb-jar.xml of the EJB

Don't I need to setup some JNDI URL somewhere? How exactly does Seam will find the EJB? The interceptor is enough?

Also this means that I have to add a seam dependency in my EJB archive (because of the @Name annotation). So the web layer (Seam) "spills" into my business logic (EJB). Is this the recommended approach?

Am I missing something here?

© Stack Overflow or respective owner

Related posts about java

Related posts about seam