WildFly下的JTDS模块(JBoss)

时间:2013-11-25 11:10:10

标签: jboss jtds wildfly

我正忙着从JBoss 7.1.1升级到Wildfly 8.0.0.Beta1。我在JBoss下使用JTDS数据库驱动程序没有问题,但它在WildFly下无法运行。

我在WildFly安装中的/net/sourceforge/jtds/main/下创建了modules文件夹结构,并添加了module.xml文件,但Wildfly似乎并没有提起它。

我还尝试了/modules/system/layers/base/文件夹,因为这是WildFly下的新文件夹,但这也不起作用,我也下载了最新的JTDS .JAR文件。

启动Wildfly时出现的错误是:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "SCI_ODS_sql2")
]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
    "jboss.data-source.java:jboss/datasources/SCI_ODS is missing [jboss.jdbc-driver.JTDS]",
    "jboss.driver-demander.java:jboss/datasources/SCI_ODS is missing [jboss.jdbc-driver.JTDS]"
]}
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "SCI_ODS_sql2")
]) - failure description: {
    "JBAS014771: Services with missing/unavailable dependencies" => [
        "jboss.data-source.java:jboss/datasources/SCI_ODS is missing [jboss.jdbc-driver.JTDS]",
        "jboss.driver-demander.java:jboss/datasources/SCI_ODS is missing [jboss.jdbc-driver.JTDS]"
    ],
    "JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
        "Services that were unable to start:" => [
            "jboss.data-source.reference-factory.SCI_ODS_sql2",
            "jboss.naming.context.java.jboss.datasources.SCI_ODS"
        ],
        "Services that may be the cause:" => ["jboss.jdbc-driver.JTDS"]
    }
}

如果我运行/subsystem=datasources:installed-drivers-list uon jboss-cli.sh它只显示默认安装的h2驱动程序,而不是JTDS驱动程序。

1 个答案:

答案 0 :(得分:3)

我没有在standalone.xml中正确设置驱动程序。我已经说服自己,我已经做到了。添加了:

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