Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-335

Simple Environment Entries are not injected to Stateful Beans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • EJB 3.0 RC3
    • None
    • None
    • Compatibility/Configuration

    Description

      Fields in Stateful Beans annotated as @Resource are not injected as described in J2EE 1.5 Specification (J2EE.5.4.1.1)

      For bean declared as:

      @Stateful(name = "Manager")

      @Remote(Manager.class)

      public class ManagerBean implements Manager, Serializable

      {

      @Resource String hostname;

      [....]
      }

      and it's deployment descriptor

      <ejb-jar>
      <enterprise-beans>
      <session>
      <ejb-name>Manager</ejb-name>
      <ejb-class>test.package.ManagerBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>
      <env-entry>
      <env-entry-name>hostname</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>localhost</env-entry-value>
      </env-entry>
      </session>
      </enterprise-beans>
      </ejb-jar>

      there is not set field hostname. But accessing hostname value dynamically in such configuration using JNDI intrefaces work properly:

      hostname = (String)new InitialContext().lookup("java:comp.ejb3/env/hostname

      Field value is injected when DD has <injection-target> element.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jotel Jaroslaw Lewandowski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: