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.
Thanks you again for your time.
subject: DB connection doesn't seem to work after migration from Tomcat