-
1. Re: jboss 7.1 - installing mysql driver as deployment NOT module
yashendrac Mar 7, 2012 1:36 PM (in response to yashendrac)here are my configurations
1. standalone-full.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:/DefaultDS" pool-name="mysqlDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/apollodb</connection-url>
<driver>mysql-connector-java-5.1.18-bin.jar</driver>
<pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>200</max-pool-size>
</pool>
<security>
<user-name>xx</user-name>
<password>xx</password>
</security>
</datasource>
<drivers>
<driver name="mysql-connector-java-5.1.18-bin.jar" module="com.mysql"/>
</drivers>
</datasources>
</subsystem>
2. copied mysql-connector-java-5.1.18-bin.jar to standalone/deployments
-
2. Re: jboss 7.1 - installing mysql driver as deployment NOT module
wdfink Mar 7, 2012 2:10 PM (in response to yashendrac)See wiki, here just the relevant sentence:
Note on MySQL driver and JDBC Type 4 compliance: while the MySQL driver (at least up to 5.1.18) is designed to be a Type 4 driver, its jdbcCompliant() method always return false. The reason is that the driver does not pass SQL 92 full compliance tests, says MySQL. Thus, you will need to install the MySQL JDBC driver as a module (see below).
-
3. Re: jboss 7.1 - installing mysql driver as deployment NOT module
yashendrac Mar 7, 2012 3:53 PM (in response to wdfink)Thanks. I had seen that but then I also saw following steps, and found that mysql-connector-java-5.1.18-bin.jar already has that file in place.
I had not noticed this: Connector/J Driver reports itself as not jdbc compliant
Modify the JAR
The most straightforward solution is to simply modify the JAR and add the missing file. You can do this from your command shell by:
- Change to, or create, an empty temporary directory.
- Create a "META-INF" subdirectory.
- Create a "META-INF/services" subdirectory.
- Create a "META-INF/services/java.sql.Driver" file which contains one line - the fully-qualified class name of the JDBC driver.
- Use the "jar" command-line tool to update the JAR like this:
jar -uf jdbc-driver.jar META-INF/services/java.sql.Driver
-
4. Re: jboss 7.1 - installing mysql driver as deployment NOT module
wdfink Mar 8, 2012 2:06 PM (in response to yashendrac)It is not the META-INF alone, AFAIK the driver class itselve return false for jdbcCompliant() method.
-
5. Re: jboss 7.1 - installing mysql driver as deployment NOT module
yashendrac Mar 12, 2012 1:30 PM (in response to wdfink)Thanks, I will install it as module in place of deploying.
-
6. Re: jboss 7.1 - installing mysql driver as deployment NOT module
tonykaska Apr 9, 2012 4:56 PM (in response to yashendrac)Did you install the MySQL driver as module? Were you successful? I am not able to install it successfully. If you can share your experience that will be helpful. Thank you.
-
7. Re: jboss 7.1 - installing mysql driver as deployment NOT module
wdfink Apr 10, 2012 3:52 AM (in response to tonykaska)Is it still a problem?
How do you proceed? What error messages do you see?
-
8. Re: jboss 7.1 - installing mysql driver as deployment NOT module
yashendrac Apr 10, 2012 8:45 AM (in response to tonykaska)1 of 1 people found this helpfulAs suggested by Fink. I have installed it as module.
Created this under jboss 7 modules
com\mysql\jdbc\main\
module.xml
mysql-connector-java-5.1.18-bin.jar
content of module.xml
<module xmlns="urn:jboss:module:1.1" name="com.mysql.jdbc">
<resources>
<resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
data source configuration under standalone.xml or the one you are using, I use standalone-full.xml
<datasources>
<datasource jndi-name="java:jboss/DefaultDS" pool-name="MySQLDefaultDS" enabled="true" jta="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/myappdbname</connection-url>
<driver>mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>40</max-pool-size>
</pool>
<security>
<user-name>root</user-name>
<password>xxx</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>
false
</validate-on-match>
<background-validation>
false
</background-validation>
<use-fast-fail>
false
</use-fast-fail>
</validation>
<timeout>
<blocking-timeout-millis>
5000
</blocking-timeout-millis>
</timeout>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql.jdbc"/>
</drivers>
</datasources>
-
9. Re: jboss 7.1 - installing mysql driver as deployment NOT module
sergeib Oct 10, 2012 10:32 AM (in response to wdfink)Hi Wolf-Dieter Fink.
Thank you for help.
This works for me.