the Bean Provider must not use a env-entry element to declare it. Instead, the Bean Provider must declare all references to administered objects associated with resources using the resource-env-ref elements of the deployment descriptor.
I don't quite understand what the spec really mean? Further more, what's the diff between resource-ref and resource-env-ref? Why to use resource-env-ref instead of resource-ref?
This topic is covered in the last chapter of HFE. The main difference is that with <resource-ref> -declarations you can configure connection factories (javax.sql.DataSource, javax.jms.Queue, java.net.URL and javax.mail.Session), and with <resource-env-ref> declarations you can configure administered objects (currently only JMS destinations). Don't ask why it has been made so complicated thou!