The DataSource is set up properly. The problems are in getting your code to find it.
You might be able to say
or you could add a link in jboss.xml connecting
jdbc/MySQLDS (the name your code uses, as in
java:/comp/env/jdbc/MySQLDS) to java:/MySQLDS (the jndi binding location)
I think how to do this is covered in the online manual and is used in several testcases.
the use of DefaultDS as default datasource for CMP is specified in the
standardjaws.xml file in your jboss config directory
you can change either this ( which i would not recommend ) or
put your own jaws.xml in the META-INF directory
of your ejb jar
in your case, the jaws.xml should have at least the following content:
<?xml version="1.0" encoding="UTF-8"?>
Thanks chgrimm, my reply is irrelevant, I was misled by the ejb-ref stuff and did not notice "CMP"