glassfish
  1. glassfish
  2. GLASSFISH-8813

Cannot inject env-entry declared in application.xml

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: V3
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      8,813

      Description

      Some env-entry elements are declared in application.xml to be available to all
      components inside this app. But the injection of these env-entry with @Resource
      into ejb bean class and servelt does not happen.

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      version="6" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/application_6.xsd">
      <module>
      <web>
      <web-uri>xxx.war</web-uri>
      <context-root>xxx</context-root>
      </web>
      </module>

      <module>
      <ejb>xxxx.jar</ejb>
      </module>

      <env-entry>
      <env-entry-name>java:app/env/myString</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>myString</env-entry-value>
      </env-entry>

      @Resource(name = "java:app/env/myString")
      protected String myString;

      myString is null when checked inside post-construct method.

        Activity

        Hide
        ksak added a comment -

        need further analysis

        Show
        ksak added a comment - need further analysis
        Hide
        jthoennes added a comment -

        Ken, will you also have a look at these issues also related to env-entry:

        #6653: session bean resource values not being set correctly
        #8614: [DEA] message driven bean resource values not being set correctly

        These issues prevent to re-use a Java class in several differently named beans.

        Show
        jthoennes added a comment - Ken, will you also have a look at these issues also related to env-entry: #6653: session bean resource values not being set correctly #8614: [DEA] message driven bean resource values not being set correctly These issues prevent to re-use a Java class in several differently named beans.
        Hide
        ksak added a comment -

        Fixed.

        Show
        ksak added a comment - Fixed.
        Hide
        ksak added a comment -

        Forgot to mark it Fixed.

        Show
        ksak added a comment - Forgot to mark it Fixed.

          People

          • Assignee:
            ksak
            Reporter:
            Cheng Fang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: