Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jboss

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?

like image 593
pulse Avatar asked Jul 08 '13 19:07

pulse


2 Answers

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.

like image 167
kosa Avatar answered Nov 08 '22 17:11

kosa


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]
like image 41
M R Javeed Avatar answered Nov 08 '22 18:11

M R Javeed