Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-4361

Resource injection of simple env. entry types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.3, 2.2
    • 2.1.4, 2.2
    • deployment
    • Security Level: public (Regular issues)
    • None

    Description

      There are a couple problems with @Resource injection of simple env. types:

      1) If @Resource.mappedName attribute is specified, it becomes the env-entry value. For example, if we have @Resource(mappedName = "java:comp/env/bar") String foo, the injected value of "foo" will be "java:comp/env/bar". That's incorrect.

      2) Right now, @Resource String foo = "bar". without a corresponding env-entry in the DD will cause a deployment (injection) exception (since there is no entry for it in the JNDI context). However, according to the Java EE 5 spec, section EE.5.4.1.3, "... the container must only inject a value for this resource if the deployer has specified a value to override the default value" and since the generated DD entry for this resource will have no env-entry-value element, the injection should not happen (and so the application should deploy without an error).

      Attachments

        Activity

          People

            gawor@mcs.anl.gov Jarek Gawor
            gawor@mcs.anl.gov Jarek Gawor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: