【问题标题】:Issue while connecting to Microsoft SQL from EAP 7.0从 EAP 7.0 连接到 Microsoft SQL 时出现问题
【发布时间】:2019-07-25 22:55:44
【问题描述】:

我在standalone.xml 中定义了我的JNDI 数据源

<datasource jta="false" jndi-name="java:/dailymenu" pool-name="dailymenu" enabled="true">
   <connection-url>jdbc:sqlserver://<host>:<port>;DatabaseName=<db-name>;</connection-url>
   <driver>mssql</driver>
   <security>
      <user-name><username></user-name>
      <password><pw></password>
   </security>
</datasource>

在该部分:

<driver name="mssql" module="com.mircosoft.sqlserver.jdbc">
   <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
</driver>

我在 ‎jboss-eap-7.0 ▸ modules ▸ com ▸ microsoft ▸ sqlserver ▸ jdbc ▸ main 中添加了 module.xml(连同 mssql- jdbc-7.2.1.jre8.jar)

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver.jdbc">
<resources>
    <resource-root path="mssql-jdbc-7.2.1.jre8.jar"/>
</resources>
<dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
</dependencies>
</module>

但是,当我启动 jBoss 时:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "dailymenu.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"dailymenu.war\".component.DailyMenuApplication.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"dailymenu.war\".component.DailyMenuApplication.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBException: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Caused by: org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [dailymenu]
Caused by: javax.naming.NameNotFoundException: dailymenu [Root exception is java.lang.IllegalStateException]
Caused by: java.lang.IllegalStateException"},
"WFLYCTL0288: 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.deployment.unit.\"dailymenu.war\".deploymentCompleteService",
        "jboss.deployment.unit.\"dailymenu.war\".moduleDeploymentRuntimeInformationStart",
        "jboss.undertow.deployment.default-server.default-host./dailymenu",
        "jboss.undertow.deployment.default-server.default-host./dailymenu.UndertowDeploymentInfoService"
    ],
    "Services that may be the cause:" => ["jboss.jdbc-driver.mssql"]
}
}

【问题讨论】:

    标签: sql-server jdbc jboss datasource


    【解决方案1】:

    好的,我有一个错字。驱动模块名称应该 - 当然 - 与 module.xml 的路径完全匹配(不带“main”)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-15
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-18
      • 2014-09-12
      相关资源
      最近更新 更多