-
1. Re: How to select <driver-class> when driver is installed as deployment
mmusaji May 12, 2015 7:32 AM (in response to jholusa)I have mysql-connector-java-5.1.33-bin.jar copied in the SERVER/standalone/deployments and the datasource is not being loaded.
....
What am I doing wrong?
Why are you deploying your driver to the deployments directory in the first place? Install it as a module which is the recommended approach and then that driver can be used by all your applications. This is the benefit of using modules. Otherwise you get in to classloading issues and adding dependencies to your deployment(s) which gets complicated very quickly.
-
2. Re: How to select <driver-class> when driver is installed as deployment
lafr May 12, 2015 3:13 PM (in response to mmusaji)Mustafa, you're wrong. See https://docs.jboss.org/author/display/WFLY8/DataSource+configuration.
-
3. Re: How to select <driver-class> when driver is installed as deployment
jholusa May 12, 2015 4:10 PM (in response to mmusaji)Hi Mustafa,
exactly as Frank says, quoting from documentation: "The recommended way to install a JDBC driver into WildFly 8 is to deploy it as a regular JAR deployment."
-
4. Re: How to select <driver-class> when driver is installed as deployment
jamezp May 12, 2015 4:51 PM (in response to jholusa)If you execute the following CLI command you'll see some information about the drivers deployed.
/subsystem=datasources:read-attribute(name=installed-drivers)
Output:
{ "outcome" => "success", "result" => [ { "driver-name" => "mysql-connector-java-5.1.35-bin.jarcom.mysql.jdbc.Driver_5_1", "deployment-name" => "mysql-connector-java-5.1.35-bin.jarcom.mysql.jdbc.Driver_5_1", "driver-module-name" => undefined, "module-slot" => undefined, "driver-datasource-class-name" => undefined, "driver-xa-datasource-class-name" => undefined, "driver-class-name" => "com.mysql.jdbc.Driver", "driver-major-version" => 5, "driver-minor-version" => 1, "jdbc-compliant" => false }, { "driver-name" => "mysql-connector-java-5.1.35-bin.jarcom.mysql.fabric.jdbc.FabricMySQLDriver_5_1", "deployment-name" => "mysql-connector-java-5.1.35-bin.jarcom.mysql.fabric.jdbc.FabricMySQLDriver_5_1", "driver-module-name" => undefined, "module-slot" => undefined, "driver-datasource-class-name" => undefined, "driver-xa-datasource-class-name" => undefined, "driver-class-name" => "com.mysql.fabric.jdbc.FabricMySQLDriver", "driver-major-version" => 5, "driver-minor-version" => 1, "jdbc-compliant" => false }, { "driver-name" => "h2", "deployment-name" => undefined, "driver-module-name" => "com.h2database.h2", "module-slot" => "main", "driver-datasource-class-name" => "", "driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource", "driver-class-name" => "org.h2.Driver", "driver-major-version" => 1, "driver-minor-version" => 3, "jdbc-compliant" => true } ] }
You'll notice the driver-name for the two different driver names. I think you can specify the driver name instead of the driver class.
The linked JIRA was for WildFly so it should be fixed there. I'm not sure if it's fixed in EAP 6.x or not though.
--
James R. Perkins
-
5. Re: How to select <driver-class> when driver is installed as deployment
mmusaji May 13, 2015 4:03 AM (in response to jholusa)Yeah my apologies, I thought this was for EAP 6.x as original post did say you had to use EAP 6.x. In EAP 6.x the recommended way is to install it as a module.
-
6. Re: How to select <driver-class> when driver is installed as deployment
heiko.braun May 14, 2015 3:53 AM (in response to mmusaji)Apart from the what the documentation says, a module is certainly the recommended and more reliable way. In particular when using the domain mode.
-
7. Re: How to select <driver-class> when driver is installed as deployment
jholusa May 20, 2015 3:11 AM (in response to jamezp)(Sorry for late reply)
Thanks James, this was exactly what I needed. I would never come up with this