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

env-entry injection only works if Stateless/Statefull annotation is used with param name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • None
    • EJB3 Extensions
    • None

    Description

      You have a simple Stateless Session Bean:

      @Stateless
      @Remote(

      { TestSession.class }

      )
      @RemoteBinding(jndiBinding = "ejb3/TestSession")
      public class TestSessionBean implements TestSession {

      @Resource(name="paramOne")
      private String paramOne = "";

      public String getParamOne()

      { return paramOne; }

      }

      And the deployment descriptor (corresponding part):
      <enterprise-beans>
      <session id="TestSession">
      <ejb-name>TestSession</ejb-name>
      <env-entry>
      <env-entry-name>
      paramOne
      </env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>valueOne</env-entry-value>
      </env-entry>
      </session>
      </enterprise-beans>

      This does not work!
      The value is not injected.

      It only is injected if you use the Stateless annotation with name parameter:

      @Stateless(name="TestSession")

      This is not acceptable because you would want to have several SessionBeans defined by the same bean class.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cgr.sybit Christian Güttinger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: