Mantis - Resin
Viewing Issue Advanced Details
1322 minor always 08-30-06 17:29 09-05-06 15:01
gzhu x86  
ferg Linux  
normal 2.6.7.1  
closed 3.0.21  
Thu, 10 Aug 2006 12:03:19 PDT fixed  
none    
none 3.0.22  
0001322: Within Enterprise Bean Context, environment entries not stored for CMP EJB 2
Environment entries defined in EJB CMP 2.0 are not stored in EJB context - JNDI lookup returns null.

Stateless session bean can still have environment entries defined and looked up correctly. Somewhat consistent with EJB3 spec, since 'Entity' is no longer an EJB.





Define a simple CMP (EJB2), with following in your ejb-jar.xml:

  <env-entry>
      <env-entry-name>testEnvName</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>testEnvValue</env-entry-value>
  </env-entry>

Inside that CMP:
   String thisValue = (String)
           (new InitialContext()).lookup("java:comp/env/testEnvName");
   // thisValue would be "testEnvValue" with 3.0.19; and
   // thisValue would be null with 3.0.21



Notes
(0001500)
ferg   
09-05-06 15:01   
ejb/086d