0

I have installed Wildfly 22.0.1. I added a MariaDB connector and a datasource in the standalone.xml:

<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>

Which I connects just fine when I test it in the HAL Management Console.

The problem occurs when I try deploying my EAR with the following persistence.xml file in the EJB jar file.:

  <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>

The following error is reported on deployment:

  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\"]"
     ]
  }

As always, many thanks for any help offered.

Dobbo

Dobbo
  • 1,188
  • 3
  • 16
  • 27
  • You seem to be lacking dependencies. Maybe you can share your dependency management file? – Giorgi Tsiklauri Feb 20 '21 at 11:49
  • @GiorgiTsiklauri What is a dependency management file? – Dobbo Feb 20 '21 at 12:00
  • Read the log. There are some dependencies (.jar files, that is libraries, framework parts, etc.) missing. They need to be either provided within the application, or by the server running that application. – Giorgi Tsiklauri Feb 20 '21 at 12:07
  • Hi @GiorgiTsiklauri thanks for your help in this. I'm now at a complete loss. My EAR deploys just fine without the persistence.xml file. There is only one Singleton/Startup service been (and one persistent JPA bean) and I have the `@PersistenceContext` commented out and a test not to call any methods on the EntityManager if it is null. So I conclude that the missing dependencies are due to some missing configuration. – Dobbo Feb 20 '21 at 13:00
  • Your persistence unit seems to be broken somehow, I'm not an expert but those DBCP properties look wrong to me since your datasource is provided by WildFLy using ironjacamar – ehsavoie Feb 22 '21 at 07:47

0 Answers0