[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-1813) @Resource does not inject simple environment entries

Andrew Lee Rubinger (JIRA) jira-events at lists.jboss.org
Mon Apr 27 18:47:46 EDT 2009


@Resource does not inject simple environment entries
----------------------------------------------------

                 Key: EJBTHREE-1813
                 URL: https://jira.jboss.org/jira/browse/EJBTHREE-1813
             Project: EJB 3.0
          Issue Type: Bug
          Components: core
            Reporter: Andrew Lee Rubinger
            Assignee: Andrew Lee Rubinger


Given:

      <!-- Override the one-way hash MessageDigest algorithm -->
      <env-entry>
        <env-entry-name>messageDigestAlgorithm</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>SHA</env-entry-value>
      </env-entry>

All that should be required for injection is @Resource upon a field of same name within the bean class:

   @Resource
   private String messageDigestAlgorithm;

Spec 16.4.1.1:

The Bean Provider uses the Resource annotation to annotate a field or method of the bean class as a
target for the injection of a simple environment entry. The name of the environment entry is as described
in Section 16.2.2; the type is as described in Section 16.4.

WARN message in logs is:

17:37:00,963 WARN  [ResourceHandler] Not injecting messageDigestAlgorithm, no matching enc injector env/org.jboss.ejb3.examples.ch05.encryption.EncryptionBean/messageDigestAlgorithm found

ENC is:

  +- EJBContext (class: javax.ejb.EJBContext)
  +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
  +- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- messageDigestAlgorithm (class: java.lang.String)
  |   +- ciphersPassword (class: java.lang.String)
  |   +- org.jboss.ejb3.examples.ch05.encryption.EncryptionBean (class: org.jnp.interfaces.NamingContext)
  |   |   +- context[link -> java:comp/EJBContext] (class: javax.naming.LinkRef)
  +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list