Hi,
Does anyone know if it is possible to have ear file deployed on jboss with datasource bundled in it instead of having datasource xml file in jboss/server/xxx/deploy directory.
Currently i this in my jboss-cmp xml file
<jbosscmp-jdbc>
<defaults>
<datasource>java:/MyOwnDSMYSQL</datasource>
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>false</remove-table>
</defaults>
......
and then i have datasource file mysql-ds.xml in jboss/server/xxx/deploy which deploys the datasource using the jndi binding MyOwnDSMYSQL.
<datasources>
<local-tx-datasource>
<jndi-name>MyOwnDSMYSQL</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/databasename</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password></password>
</local-tx-datasource>
</datasources>
It'd be great if somehow the datasource stuff could be configured within my ear, and not have to copy or edit the external mysql-ds.xml file. This would allow for simple deployment of ear on jboss server, just one file.
Any thoughts?
thanks.
-
JBoss ear datasource. (2 messages)
- Posted by: John Shuster
- Posted on: July 04 2005 07:35 EDT
Threaded Messages (2)
- JBoss ear datasource. by Ashwin Karkala on July 18 2005 05:08 EDT
- Jboss war datasource by Parmod Mehta on December 17 2009 16:43 EST
-
JBoss ear datasource.[ Go to top ]
- Posted by: Ashwin Karkala
- Posted on: July 18 2005 05:08 EDT
- in response to John Shuster
In the application.xml add the following
<module>
<java><your_jboss_ds.xml_file></java>
</module>
Lets say your ds xml name is jboss-ds.xml and is available in the root of the application.xml. Then the above becomes
<module>
<java>jboss-ds.xml</java>
</module>
If your ds.xml is inside conf/ folder of the ear then try
<module>
<java>conf/jboss-ds.xml</java>
</module>
Note: Choose a better name for your ds.xml file. -
Jboss war datasource[ Go to top ]
- Posted by: Parmod Mehta
- Posted on: December 17 2009 16:43 EST
- in response to Ashwin Karkala
In the application.xml add the following
What if you are deloying a war instead? Adding mysql-ds.xml in the application.xml does not load the datasources in JBoss 4.2.2
Lets say your ds xml name is jboss-ds.xml and is available in the root of the application.xml. Then the above becomes
jboss-ds.xml
If your ds.xml is inside conf/ folder of the ear then try
conf/jboss-ds.xml
Note: Choose a better name for your ds.xml file.