1. Have you put mysql driver file in
JBoss server's lib folder.
2. From C:\jboss-4.0.0\docs\examples\jca directory you can get mysql-ds.xml file and place it in JBoss server's deploy folder.
3. Edit this file for <jndi-name>,<connection-url>,<driver-class>,<user-name>, <password>
4. In login-config.xml file if you have
<application-policy name = "someDbRealm"> specified. If yes then check for
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=This should be same as <jndi-name> in step 3.</module-option>
5. <security-domain> in mysql-ds.xml file at step 2. should be same as application-policy name at step4.