Thank you for your answer.
What is the difference between runtime and "when the component is initialized" ?
The component is not initialized at runtime ??
I am sorry but i don't understand.
I understood that, during the deployment, "injected resource" is binding in the ENC of managed bean with the path declared by the attribute name => java:/comp/env/[name]
And that during execution, the resource is accessible (with injection or direct access) via the ENC entry.
But i don't understand the goal of the class level annotation (and so the goal of the <resource-ref>).
I you want use directly JNDI and if you do not declare class level annotation, you will have not entry in the ENC but you can lookup to the global JNDI, no ?
I am sure i missed something...
Thank you for your help