Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
EJB 3.0 RC3
-
None
-
None
-
Compatibility/Configuration
Description
Fields in Stateful Beans annotated as @Resource are not injected as described in J2EE 1.5 Specification (J2EE.5.4.1.1)
For bean declared as:
@Stateful(name = "Manager")
@Remote(Manager.class)
public class ManagerBean implements Manager, Serializable
{
@Resource String hostname;
[....]
}
and it's deployment descriptor
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Manager</ejb-name>
<ejb-class>test.package.ManagerBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>hostname</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>localhost</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
</ejb-jar>
there is not set field hostname. But accessing hostname value dynamically in such configuration using JNDI intrefaces work properly:
hostname = (String)new InitialContext().lookup("java:comp.ejb3/env/hostname
Field value is injected when DD has <injection-target> element.
Attachments
Issue Links
- relates to
-
EJBTHREE-365 Env-entry needs to be fully tested to see if it conforms to spec
- Closed