简体   繁体   中英

JBoss and MySQL New missing/unsatisfied dependencies

I'm a Java and JBoss newbie struggling to get JBoss AS 7.0.1 working with mySQL 5.5 on my Windows 10 machine.
I get the following error when I start JBoss:-

16:19:39,480 INFO [org.jboss.as.controller] (Controller Boot Thread) Service status report New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_mysql (missing)

This is what I've done

1 created directory jboss-as-7.0.1.Final\\modules\\com\\mysql\\main

2 Files there: module.xml and mysql-connector-java-5.1.26-bin.jar (downloaded from official mysql site)

3 Content of module.xml:

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

4 Relevant parts from jboss-as-7.0.1.Final\\standalone\\configuration\\standalone.xml:

        <datasources>
            <datasource jndi-name="java:/jbossdbDS" pool-name="my_pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                <connection-url>
                    jdbc:mysql://localhost:3306/jbossdb
                </connection-url>
                <driver>
                    com.mysql
                </driver>
                <security>
                    <user-name>
                        root
                    </user-name>
                    <password>
                        password
                    </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/>
                </statement>
            </datasource>
            <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                <connection-url>
                    jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
                </connection-url>
                <driver>
                    h2
                </driver>
                <pool>
                    <prefill>
                        false
                    </prefill>
                    <use-strict-min>
                        false
                    </use-strict-min>
                    <flush-strategy>
                        FailingConnectionOnly
                    </flush-strategy>
                </pool>
                <security>
                    <user-name>
                        sa
                    </user-name>
                    <password>
                        sa
                    </password>
                </security>
            </datasource>
            <drivers>
                <driver name="mysql" module="com.mysql"/>
                <driver name="h2" module="com.h2database.h2">
                    <xa-datasource-class>
                        org.h2.jdbcx.JdbcDataSource
                    </xa-datasource-class>
                </driver>
            </drivers>
        </datasources>

You have mentioned the mysql jar file name in modules as

mysql-connector-java-5.1.26-bin.jar

But in your module.xml it is incorrectly configured as

mysql-connector-java-5.1.39-bin.jar

Pls Correct your module.xml

Your driver configured in datasource with name

        <driver>
            com.mysql
        </driver>

Update that to your correct driver name as

            <driver>
                mysql
            </driver>

Thanks for the responses.

Turns out the mysql-connector-java-5.1.39-bin.jar file was corrupt, the java.sql.Driver file inside it was empty. Not sure how that happened!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM