@Resource annotation is null at run-time.
- by Andrew
I'm using GlassFish v3. The following field is declared in a class:
@Resource
private javax.sql.DataSource _data_source;
The following is declare in web.xml:
<data-source
<namejava:app/env/data</name
<class-namecom.mysql.jdbc.Driver</class-name
<server-namelocalhost</server-name
<port-number3306</port-number
<usermyUser</user
<passwordmyPass</password
</data-source
At run-time _data_source is empty. What am I doing wrong?