I am very confused for the deployment of datasources on JBoss 7.
From JBoss 3.x until JBoss 6.1.x, datasource deployment used to be done by:
- Installing the appropriate JAR
- Declaring the datasource with a DS XML file:
<?xml version="1.0" encoding="UTF-8"?>
With JBoss 7, this has drastically changed:
- Installing the JAR is, for most JDBC drivers, putting it in the deploy directory -which is perfectly fine
- The declaration of the datasource needs to be in the standalone.xml file, i.e. the file where the whole server's configuration is. This I believe is not convenient at all, as people can accidentally break things while modifying the file. It also makes things much more difficult if we want to use a JBoss server shared between different applications.
- The driver-class attribute does not exist anymore; we now rather need to define a module name... which is confusing as only JBoss 7 has such a requirement: no previous versions of JBoss, neither any other server I know of (Tomcat, GlassFish, WebLogic, JOnAS, ...) have such a terminology nor requirement. The biggest difficulty I've encountered with all administrators is the answer to the question: "but how do I guess the module name"? It would be great if we could only have the driver-class attribute back again.
So, I have one question: is the DS XML file that we have been using for years, with the very convenient driver-class attribute, going to be re-implemented at some point?
you have to configure standalone.xml to add datasource and I too think it's strange, but you doesn't have to do it manually - there are tools which will do it for you. For example command line tool, JBoss GUI or JBoss maven plugin (hovewer maven plugin can't add enabled datasource, so you have to enable it manually).
Thank you for your helpful answer, I've also found some details on http://planet.jboss.org/post/how_to_create_an_manage_datasources_in_as7
Now, a question still remains: is there a way to still use the driver-class attribute, instead of having to find out the proper driver-name?