2 Replies Latest reply on Mar 2, 2006 8:03 PM by Bill Burke

    Injecting a String

    Frank Cornelis Apprentice

      In my MDB I have:

      @Resource(mappedName = "TheStringResource")
      private String theStringResource;
      

      I also have a resource-env-ref in both my ejb-jar.xml and jboss.xml. But when onMessage is invoked it gives me null for the value of the 'theStringResource' variable. And this while:
      String value = new InitialContext().lookup("TheStringResource");
      

      is retrieving the correct value. Isn't is possible to inject Strings via @Resource or am I doing something wrong here? Using 4.0.4RC1.