OschtärEi OschtärEi - 6 months ago 36
Java Question

Can't add mysql driver to jboss

Ok this is driving me crazy. Especially because there are already many similar questions out there. But no answer works for me.

I have jboss 7.1.1 on my windows 7 machine (running it from eclipse normally) and want to use mysql.

I did the following:

1 created directory


2 Files there:
(downloaded from official mysql site)

3 Content of

<?xml version="1.0" encoding="UTF-8"?>
<modulexmlns="urn:jboss:module:1.0" name="com.mysql">

4 Relevant parts from

<datasource jndi-name="java:jboss/datasources/mysqlDS" pool-name="mysqlDS" enabled="true" jta="true" use-ccm="true" use-java-context="true">


<driver name="com.mysql" module="com.mysql" />

Everytime I start the jboss server I see this message:

service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/datasources/mysqlDS]

And when I go to the managment-console and look at datasources, the mysqlDS is listed there, but when I click on it I get the error (sorry can't select the text there, so here comes the image):

error from managment console


So once more I can pay tribute to my stupidity. I did everything right except I had typos in my module.xml file. Notice that in the code above are no blanks (" ") between some words - somehow they got lost. But what's even worse is that apparantly these module-files are not validated by jboss, that's why I never realized it. Anyway here's the correct config without the typos...

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
     <resource-root path="mysql-connector-java-5.1.26-bin.jar"/>              
     <module name="javax.api"/>