JBoss AS 4.0.3 is a very ancient version. It doesn't support any injection of resources. From what I remember, there was a plugin for AS 4.0.5 (which again is an ancient version), but I don't know how good it is/was. Your best bet is AS 5.1.0. But if you want to stick to AS-4, then you might want to try 4.2.3 which supports injection only in EJBs.