This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Getting a null datasource (instead of a NameNotFoundException) from JNDI lookup usually ends up being a classloader issue. Do you have any jar files in your application which contain javax.sql.* classes or any JBoss specific jar files? If yes, remove them from the application packaging.
Thanks you both for the advices. In the end, it turned out to be a classloading issue. I removed the DB drivers from the app package, put the JAR into server/default/lib only, restared JBoss and it works fine.