-
1. Re: Why does this normal MySql datasource set up fail?
jaysensharma Nov 23, 2015 11:35 PM (in response to gberish)Try creating the Module itself using the jboss-cli.sh command rather than manually writing the module.xml file. This is because when we use some text editors, they might append some hidden chars to our files. (Specially when we do a copy & paste in such editors)
[standalone@localhost:9990 /] module add --name=com.mysql.driver --dependencies=javax.api,javax.transaction.api --resources=/PATH/TO/mysql-connector-java-5.1.35.jar [standalone@localhost:9990 /] :reload { "outcome" => "success", "result" => undefined }
After running above command you should see the module.xml generated in the following location: "wildfly-8.2.1.Final/modules/com/mysql/driver/main/module.xml"
Now create DataSource:
[standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=mysql/:add(driver-module-name=com.mysql.driver,driver-name=mysql,jdbc-compliant=false,driver-class-name=com.mysql.jdbc.Driver) {"outcome" => "success"}
Regards
Jay SenSharma
-
2. Re: Why does this normal MySql datasource set up fail?
mayerw01 Nov 24, 2015 6:23 AM (in response to gberish)George, l understand WildFly is checking against the jar file for searching the driver when using your approach. So you could also try to change your path to ${WILDFLY_HOME}/modules/system/layers/base/com/mysql/main/ instead.
-
3. Re: Why does this normal MySql datasource set up fail?
gberish Nov 24, 2015 5:31 PM (in response to jaysensharma)1 of 1 people found this helpfulJay,
Once again your solution was correct on the first try.
To anyone who follows, using jboss-cl seems like a good advice.
However, in my case I'm not sure if that was the most important cause of failure.
What I think was causing my problem was a disconnect between the values set in module.xml, and where I stored it.
I was likely reading the same advice offered in another comment below, because I was storing module.xml and the driver jar in "wildfly-8.2.1.Final/modules/system/layers/base/com/mysql/driver/main".
When I stored them in "wildfly-8.2.1.Final/modules/com/mysql/driver/main/ instead, it worked perfectly.