The EJB3 specification (15.2.3) says:
Environment entries may be declared by the use of annotations, without need for any deployment
descriptor entries. Environment entries may also be declared by deployment descriptor entries, without
need for any annotations. The same environment entry may be declared using both an annotation and a
deployment descriptor entry. In this case, the information in the deployment descriptor entry may be
used to override some of the information provided in the annotation. This approach may be used by an
Application Assembler to override information provided by the Bean Provider.
<env-entry> <env-entry-name>myConfigUrl</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value><![CDATA[resource:myconfig.xml]]></env-entry-value> </env-entry>
private @Resource(name="myConfigURL", type=java.lang.String.class) String myConfigURL;