pulse
pulse

Reputation: 83

New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/MyDB]

I am using JBoss 7.1.1. When I try to start the server, I get an exception. I have tried many solutions but nothing seems to work.

The following line appears in the logs -

New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/MyDB]

Here is my standalone.xml:

</datasource>
    <datasource jta="true" jndi-name="java:jboss/MyDB" pool-name="MyDB_Pool" enabled="true" use-java-context="true" use-ccm="true">
        <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
        <driver>com.mysql</driver>
        <security>
            <user-name>root</user-name>
            <password>root</password>
        </security>
        <timeout>
            <idle-timeout-minutes>0</idle-timeout-minutes>
            <query-timeout>600</query-timeout>
        </timeout>
        <statement>
            <prepared-statement-cache-size>100</prepared-statement-cache-size>
            <share-prepared-statements>true</share-prepared-statements>
        </statement>
    </datasource>
    <drivers>
        <driver name="h2" module="com.h2database.h2">
            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
        </driver>
        <driver name="com.mysql" module="com.mysql">
            <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
        </driver>
    </drivers>
</datasources>

This is my module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
    <resource-root path="mysql-connector-java-5.1.24-bin.jar"/>
</resources>
<dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>       
    <module name="javax.servlet.api" optional="true"/>
    <module name="javax.validation.api"/>
</dependencies>
</module>

But i still got this exception

Here is my web.xml(a part of it):

<resource-ref id="ResourceRef_1">
    <res-ref-name>MyDB</res-ref-name>        
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    <lookup-name>java:jboss/datasources/MyDB</lookup-name>
</resource-ref>

Can anyone help?

Upvotes: 7

Views: 34739

Answers (6)

jcdhlzq
jcdhlzq

Reputation: 11

Try below steps. i solve the same problem with you in wildfly8.0.0-final. if there occurs that duplicate mysql dependencies, remove configuration firstly, after restart your computer, try the steps again.

1. Create mysql folder

under: ${WILDFLY_HOME}/modules/system/layers/base

create the directories com/mysql/driver/main

copy the driver library jar Into the folder main

add module.xml

// urn:jboss:module:X.X should be same with the version of wildfly, you can reference other modules.

<module xmlns="urn:jboss:module:1.1" name="com.mysql.driver">
    <resources>
         <resource-root path="mysql-connector-java-5.1.16.jar" />
    </resources>
    <dependencies>
         <module name="javax.api"/>
         <module name="javax.transaction.api"/>
    </dependencies>
</module>

2. Register the module as driver with CLI.

${WILDFLY_HOME}/bin/standalone.sh (only if wildfly is not running)

./jboss-cli.sh

connect

/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql.driver,driver-class-name=com.mysql.jdbc.Driver)

If the operation is successful then the message below will be showed {"outcome" => "success"}

and into the file of the standalone profile the code below is produced ...

<driver name="mysql" module="com.mysql.driver">
    <driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>

3. Create database in mysql

login as root: mysql root -p
Create database

create tables

4. Create connection to database from console

http://localhost:9990/console

add datasources with configuration like

name: mysql
JNDI name: java:jboss/mysql
url: jdbc:mysql://localhost:3306/your_database

done.

Upvotes: 0

user6005619
user6005619

Reputation: 27

One thing to check with this error is to make sure you are storing the data in the correct folder. For JBoss EAP 7.1, it is the modules\system\layers\base\com folder. Inside of the com folder, create an additional folder called mysql and a main folder inside of the mysql folder. The main folder will hold the jar file and the module.xml file.

Upvotes: 0

M R Javeed
M R Javeed

Reputation: 89

Solved: New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_ for Jboss / WildFly 10

Hi, first stop the WildFly server. then update standalone.xml file to add MS-SQL JTDS driver details and Datasource details like below:

<subsystem xmlns="urn:jboss:domain:datasources:4.0">
            <datasources>
                <datasource jta="true" jndi-name="java:/jdbc/speedtest-datasource" pool-name="MSSQLDSspeedTestDEV" enabled="true" use-ccm="true">
                    <connection-url>jdbc:jtds:sqlserver://serverName:1433;DatabaseName=dbName</connection-url>
                    <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
                    <driver>JTDS</driver>
                    <security>
                        <user-name>username</user-name>
                        <password>password</password>
                    </security>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>
                        <background-validation>true</background-validation>
                    </validation>
                </datasource>
                <drivers>

                    <driver name="JTDS" module="net.sourceforge">
                        <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
                    </driver>

                </drivers>
            </datasources>
        </subsystem>

Module.xml for MS SQL JTDS: path : E:\Softwares\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\net\sourceforge\main ( need to create directory structure as highlighted and add module.xml and jtds-1.3.0.jar files).

(note in this example i have used module name as "net.sourceforge" and created the folder structure path as "net\sourceforge\main"). Please note this is more important to match the directory path and module name in module,xml file.

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge">
<resources>
<resource-root path="jtds-1.3.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

Note: Please note that the path highlighted in green above at 2 places should match (ie directory structure and module name in module.xml),

For example. If you have created directory structure as E:\Softwares\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\net\sourceforge\jtds\main then module name in module.xml file should be “net.sourceforge.jtds” as shown below in module.xml file

Module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">
<resources>
<resource-root path="jtds-1.3.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

now save these two files and restart the wildFLY server.

Regards,
Rasool Javeed Mohammad
[email protected]

Upvotes: 1

thalespf
thalespf

Reputation: 388

Try to delete META-INF/services/java.sql.Driver from the mysql connector lib.

Upvotes: 0

him
him

Reputation: 608

try upgrading your mysql-connector. i was trying to deploy 5.1.5 (i was migrating from jboss 5.1 to 7.1.1 so i was just moving an already working environment over to the newer container). after banging my head against this for two days, i upgraded to 5.1.27 and the datasource deployed like a champ.

Upvotes: 0

kosa
kosa

Reputation: 66677

Your module.xml should be like this:

<module xmlns="urn:jboss:module:1.0" name="com.mysql" slot="main">
  <resources>
    <resource-root path="mysql-connector-java-5.1.24-bin.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

And make sure you have mysql-connector-java-5.1.24-bin.jar and mysql-connector-java-5.1.24-bin.jar.index in same folder where you have module.xml.

Upvotes: 3

Related Questions