Wildfly 22.0.1 无法使用 MariaDB 数据源部署 EAR

问题描述

我已经安装了 Wildfly 22.0.1。 我在 standalone.xml 中添加一个 MariaDB 连接器和一个数据源:

<datasource jndi-name="java:jboss/datasources/BeckDS" pool-name="BeckDB">
  <connection-url>jdbc:mariadb://localhost/tube</connection-url>
  <driver-class>org.mariadb.jdbc.Driver</driver-class>
  <driver>mariadb</driver>
  <security>
    <user-name>username</user-name>
    <password>redacted</password>
  </security>
  <validation>
    <valid-connection-checker
      class-name="org.jboss.jca.adapters.jdbc.extensions.MysqL.MysqLValidConnectionChecker"/>
  <validate-on-match>true</validate-on-match>
  <background-validation>false</background-validation>
  <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.MysqL.MysqLExceptionSorter"/>
             </validation>
</datasource>

当我在 HAL 管理控制台中测试时,我连接得很好。

当我尝试使用 EJB jar 文件中的以下 persistence.xml 文件部署我的 EAR 时出现问题。:

  <persistence version="2.2"
        xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_2.xsd">
    <persistence-unit name="BeckPU">
      <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
      <jta-data-source>java:jboss/datasources/BeckDS</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MariaDB53Dialect"/>
         <property name="hibernate.show_sql" value="true" />
         <property name="hibernate.connection.maxIdleTime" value="60"/>
         <property name="hibernate.archive.autodetection" value="class,hbm"/>
         <property name="hibernate.dbcp.maxActive" value="8" />
         <property name="hibernate.dbcp.maxIdle" value="8" />
         <property name="hibernate.dbcp.maxWait" value="-1" />
         <property name="hibernate.dbcp.whenExhaustedAction" value="1" />
         <property name="hibernate.dbcp.testOnBorrow" value="true" />
         <property name="hibernate.dbcp.testOnReturn" value="true" />
         <property name="hibernate.dbcp.validationQuery" value="SELECT 1" />
      </properties>
    </persistence-unit>
  </persistence>

部署时报如下错误

  WFLYSRV0027: Starting deployment of "beck-ear.ear" (runtime-name: "beck-ear.ear")
  WFLYSRV0207: Starting subdeployment (runtime-name: "beck-war.war")
  WFLYSRV0207: Starting subdeployment (runtime-name: "beck-ejbs.jar")
  WFLYJPA0002: Read persistence.xml for BeckPU
  JIPIORMV53020253: Second level cache enabled for beck-ear.ear/beck-ejbs.jar#BeckPU
  WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'beck-ear.ear/beck-ejbs.jar#BeckPU'
  HHH000204: Processing PersistenceUnitInfo [
    name: BeckPU
    ...]
  Operation ("full-replace-deployment") Failed - address: ([]) - failure description: {
    "WFLYCTL0412: required services that are not installed:" => [
      "jboss.deployment.subunit.\"beck-ear.ear\".\"beck-ejbs.jar\".deploymentCompleteService","jboss.persistenceunit.\"beck-ear.ear/beck-ejbs.jar#BeckPU\""
    ],"WFLYCTL0180: Services with missing/unavailable dependencies" => [
      "jboss.deployment.subunit.\"beck-ear.ear\".\"beck-war.war\".component.\"jakarta.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START is missing [jboss.persistenceunit.\"beck-ear.ear/beck-ejbs.jar#BeckPU\"]","jboss.deployment.unit.\"beck-ear.ear\".deploymentCompleteService is missing [jboss.deployment.subunit.\"beck-ear.ear\".\"beck-ejbs.jar\".deploymentCompleteService]","jboss.deployment.subunit.\"beck-ear.ear\".\"beck-war.war\".component.\"jakarta.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START is missing [jboss.persistence unit.\"beck-ear.ear/beck-ejbs.jar#BeckPU\"]"
     ]
  }

一如既往,非常感谢您提供的任何帮助。

多宝

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...