[jboss-user] [JBoss Seam] - Env entry & @Resource

toni do-not-reply at jboss.com
Thu Jan 11 08:56:29 EST 2007


Hi,

is it possible to use the @Resource annotation to inject deploy time configured properties into a field variable of a SLSB?

Trying to inject the value into a SLSB does not work. The field of the SLSB remains NULL.

Here the ejb-jar.xml which I place in "/ejb/META-INF/":


-----------------------------------
<ejb-jar>

  <enterprise-beans>
    
      <ejb-name>EmailBean</ejb-name>
      <session-type>Stateless</session-type>
      <env-entry-name>aea</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <envv-entry-value>archive at server.de</envv-entry-value>
    
  </enterprise-beans>

  <assembly-descriptor>
    <interceptor-binding>
      <ejb-name>*</ejb-name>
      <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
    </interceptor-binding>
  </assembly-descriptor>

</ejb-jar>
--------------------------------

@Name("emailBean")
@Stateless

public class EmailBean implements EmailBeanInterface
{
  @In(create = true)
  EntityManager entityManager;

  @Resource(mappedName="java:comp/env/aea")
  String archiveEmailAddress;  
...
}
------------------------------------------------------------

Has anybody got this working with seam?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000434#4000434

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000434



More information about the jboss-user mailing list