title: Hows does Seam injection work in Ejb3
body: <p>We are using</p>
  
  <ul>
  <li>Seam 2.2.0</li>
  <li>Java 1.6.14</li>
  <li>Weblogic 10.3.1.0 (named 11g Doh!)</li>
  </ul>
  
  <p>I have looked at</p>
  
  <ul>
  <li>Seam reference</li>
  <li>Seam in action</li>
  <li><a href="http://docs.jboss.org/seam/2.1.2/reference/en-US/html/weblogic.html" rel="nofollow noreferrer">These</a> <a href="http://relation.to/Bloggers/Weblogic10SeamAndEJB3" rel="nofollow noreferrer">web</a> <a href="http://relation.to/Bloggers/SeamReferenceGuideUpdatedForWebLogic103" rel="nofollow noreferrer">pages</a> </li>
  </ul>
  
  <p>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)</p>
  
  <ol>
  <li>Annotate with @Name my backing bean</li>
  <li>Annotate with @Name my EJB3 bean</li>
  <li>Use the @In annotation in the backing bean</li>
  <li>Put an empty seam.properties file in the WAR that contains the backing bean</li>
  <li>Put an empty seam.properties file in the JAR that contains the EJB</li>
  <li>Set up a Seam interceptor in ejb-jar.xml of the EJB</li>
  </ol>
  
  <p>Don't I need to setup some JNDI URL somewhere? How exactly does Seam will find the EJB?
  The interceptor is enough?</p>
  
  <p>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?</p>
  
  <p>Am I missing something here?</p>
  
  <p><strong>Answer:</strong>
  Apparently you can set the JNDI pattern in </p>
  
  <ol>
  <li>The EJB itself with the @JndiName annotation or</li>
  <li>The web.xml file or</li>
  <li>The components.xml file or</li>
  <li>The seam.properties file as Nathan suggested (This is what I did) </li>
  </ol>