What version of JBoss do you use and what kind of client it is. The datasource should only be available inside the server and your code looks like a standalone client.
Reply to this message by going to Community
Start a new discussion in JNDI and Naming at Community