It seems JBDS runs jboss AS 5 in diffrent way as running from console.
Reproducible : always
Tested on jboss-as taken from jboss-eap-noauth-5.0.0.GA.zip
Will attach both log files.
16:02:28,141 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: No matching credentials in Subject!