Hi,
I have an ear file with a couple of ejb modules and jars etc etc. One module contains a number of entity beans, and has the appropriate jboss.xml, jbosscmp-jdnc.xml and ejb-jar.xml. All runs perfectly fine, only problem is that the jbosscmp-jdbc xml has following
    <defaults>
        <datasource>java:/MyOwnDSMYSQL</datasource>
        <datasource-mapping>mySQL</datasource-mapping>
        <create-table>true</create-table>
        <remove-table>false</remove-table>
    </defaults>
where MYOwnDSMYSQL is the name found in my data source file mysql-ds.xml which is located in my jboss deploy directory along with other ones such as oracle-ds, hsqldb-ds etc etc.

mysql-ds.xml
<datasources>
  <local-tx-datasource>
    <jndi-name>MyOwnDSMYSQL</jndi-name>
    <connection-url>jdbc:mysql://server:3306/dbname</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></password>
  </local-tx-datasource>

</datasources>


What i want to know is it possible to supply the datasource in the ear file. I would like to have a complete deployable ear, that will work straight away on a fresh jboss install (3.2.3 or higher). Currently before app is deployed, user needs to edit the mysql-ds file and then copy in the mysql jar (can i put this in my ear file) then it all works fine.

So can i have my own datasource, such as myproject-ds.xml in my ear file, that registers at deploy time and that my ejbmodule in same earfile can pick up and use.
Thank you for any suggestions.