According to the jboss-web_4_0.dtd, the resource-ref should have a res-ref-name child. Now in the /org/jboss/metadata/ResourceRefMetaData.java, it's misspelled to resource-name. And this caused me 2 days can't get the wanted result. Hope this bug can be corrected ASAP.
Regards,
Shi Yusen/Beijing Langhua Ltd.