我正在尝试使用WildFly 10.1.0设置Apache Ignite群集,因此我可以将JPA与Ignite一起使用。我在配置JDBC驱动程序时遇到问题。

到目前为止,我所做的是:

standalone-full.xml

<datasource jta="false" jndi-name="java:jboss/datasources/IgniteDS" pool-name="IgniteDS" enabled="true">
   <connection-url>jdbc:ignite:thin://172.X.X.146,172.X.X.147,172.X.X.148</connection-url>
   <driver>ignite</driver>
</datasource>

稍后在同一文件中,我设置了驱动程序
<driver name="ignite" module="org.ignite.jdbc">
    <driver-class>org.apache.ignite.IgniteJdbcThinDriver</driver-class>
</driver>

点火模块

在{WILDFLY_HOME} /模块中,我创建了以下结构
java - WildFly中的Apache Ignite数据源-LMLPHP

module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.ignite.jdbc">
    <resources>
        <resource-root path="ignite-core-2.6.0.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

不幸的是,当我启动服务器时,WildFly日志中出现以下错误
11:43:31,253 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address:
([
    ("subsystem" => "datasources"),
    ("data-source" => "IgniteDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" =>
["jboss.jdbc-driver.ignite"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.driver-demander.java:jboss/datasources/IgniteDS is missing [jboss.jdbc-driver.ignite]",
        "org.wildfly.data-source.IgniteDS is missing [jboss.jdbc-driver.ignite]"
    ]
}
11:43:31,263 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address:
([
    ("subsystem" => "datasources"),
    ("data-source" => "IgniteDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.jdbc-driver.ignite",
        "jboss.jdbc-driver.ignite"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.driver-demander.java:jboss/datasources/IgniteDS is missing [jboss.jdbc-driver.ignite]",
        "org.wildfly.data-source.IgniteDS is missing [jboss.jdbc-driver.ignite]",
        "org.wildfly.data-source.IgniteDS is missing [jboss.jdbc-driver.ignite]"
    ]
}

非常感谢您的帮助

最佳答案

  • 请注意,您有两种驱动程序,常规驱动程序(驱动程序类)或XA驱动程序(xa数据源):
      <driver name="h2" module="com.h2database.h2">
          <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
      </driver>
      <driver name="postgresql" module="org.postgresql">
          <driver-class>org.postgresql.Driver</driver-class>
      </driver>
    
  • 我有时会在数据源声明中重复看到conf,其中驱动程序类名称是...重复的(但不要问我为什么;-)):

  •  <datasource jta="false" jndi-name="java:jboss/datasources/sqlDataSource" pool-name="sqlDataSource" enabled="true" use-ccm="false">
         <connection-url>... </connection-url>
         <driver-class>com.sybase.jdbc4.jdbc.SybDriver</driver-class>
         <driver>sybase</driver>
    

  • 最终,尝试jta =“false”(在数据源级别),以防它有所不同(我怀疑,但是)
  • 关于java - WildFly中的Apache Ignite数据源,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52439984/

    10-12 20:30