5 Replies Latest reply on Oct 2, 2009 12:49 PM by Jean-Pierre RIO

    @Resource and systemproperties-service.xml

    Jean-Pierre RIO Newbie

      Hi all,
      I have a SLSB with a @Resource annotation :

      import org.jboss.ejb3.annotation.Depends;

      @Stateless(name = "SimpleSLSBResource", mappedName = "SimpleEJB30SLSBResource")
      @Remote({com.jp.ejb3.ISimpleSLSB.class})
      @Depends({"jboss:type=Service,name=SystemProperties"})
      public class SimpleSLSBResource implements ISimpleSLSB {

      @Resource(name = "serverName")
      String = "testserver";

      and i also have a ejb-jar.xml to define the resource :


      <ejb-name>SimpleSLSBResource</ejb-name>
      <env-entry>
      <env-entry-name>serverName</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>${serverName}</env-entry-value>
      </env-entry>


      and finally a systemProperties-service.xml to set the value of the resource :


      serverName=production



      When i start my JBoss AND THEN deploy my EJB, "serverName" is resolved to "production" => OK
      When i start my JBoss with my EJB in the deploy directory, "serverName" is not resolved (= ${serverName}) => KO

      I'm working on JBoss 5.1.0GA, jdk6.

      Have I made a mistake with the @Depends tag ?