Can you inject the java:/DefaultDS?
No, I have exectly the same problem with DefaultDS
Sounds strange, isn't there supposed to be an exception if injection is attempted and results in null (can't remember)?
Are you picking up the correct @Resource annotation?
Can you inject and other known resource (e.g. JavaMail)?
Can you see @Inject BeanManager bm?
Are you aquiring the class from the server and not doing new() or some other no-no?
Also what kind of a class is that, into which you are trying to inject this resource?
His becomes even stranger! I checked if I could Inject a javamail session, and that wasn't any problem. But after doing that the datasource injection worked as well. I then removed the JavaMail injection. And now it data source works as supposed, which is good, but it would be nice to understand why it failed before.
Bugs that disappear without a warning have a tendency of re-appearing when you need them the least.
It could of course be a build problem where some old class has been left lingering somewhere...
You should use the lookup attribute.