0

Trying to move my (working) PoC from WildFly 25.0.0.Final - Jakarta EE 8 Full to:

WildFly 25.0.0.Final - Preview EE 9.1 Distribution

Using HibernatePersistenceProvider with MySQL & MongoDB:

<?xml version="1.0" encoding="UTF-8"?>
<persistence 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_0.xsd"
             version="2.0">

    <persistence-unit name="nOTiFYwellMySQLPersistenceUnit" transaction-type="JTA">

        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>

        <jta-data-source>java:jboss/datasources/NOTiFYwellDS</jta-data-source>

        <class>com.notifywell.entity.FoodsCosmeticsMedicines</class>
        <class>com.notifywell.entity.Ingredients</class>

        <properties>
            <!-- <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2"/> -->
            <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.3"/>

            <property name="hibernate.connection.url" value="jdbc:mysql://127.0.0.1:3306/notifywell"/>
            <property name="hibernate.connection.driver_class" value="com.mysql.cj.jdbc.Driver"/>

            <property name="hibernate.connection.release_mode" value="auto"/>

            <property name="hibernate.connection.username" value="NOTiFY"/>
            <property name="hibernate.connection.password" value="Biggles-1957"/>

             <property name="wildfly.jpa.twophasebootstrap" value="false" />
             <property name="hibernate.cache.use_query_cache" value="false" />
             <property name="hibernate.cache.use_second_level_cache" value="false" />
             <property name="hibernate.show_sql" value="true"/>
             <property name="hibernate.format_sql" value="true"/>

             <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />

        </properties>
    </persistence-unit>

    <persistence-unit name="nOTiFYwellMongoDBPersistenceUnit" transaction-type="JTA">

        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>

        <properties>
            <!-- <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2"/> -->
            <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.3"/>

            <!-- <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.8"/> -->
            <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.10"/>

            <!-- <property name="hibernate.transaction.jta.platform" value="JBossTS"/> -->
            <!-- <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAS"/> -->
            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>
            <property name="hibernate.ogm.datastore.provider" value="org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider"/>
            <property name="hibernate.ogm.datastore.grid_dialect" value="org.hibernate.ogm.datastore.mongodb.MongoDBDialect"/>
            <property name="hibernate.ogm.datastore.database" value="notifyWellDB"/>
            <!-- <property name="hibernate.ogm.mongodb.host" value="127.0.0.1"/> -->
            <!-- <property name="hibernate.ogm.datastore.host" value="172.17.0.2:27017"/> -->
            <property name="hibernate.ogm.datastore.host" value="127.0.0.1:27017"/>
        </properties>
    </persistence-unit>

</persistence>

I've added to Gradle:

implementation group: 'org.hibernate', name: 'hibernate-search-orm', version: '5.11.9.Final'

Get:

09:40:13,191 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for nOTiFYwellMySQLPersistenceUnit
09:40:13,192 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for nOTiFYwellMongoDBPersistenceUnit

Caused by:

Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.ogm.jpa.HibernateOgmPersistence' not found

List of error:

09:40:13,668 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."NOTiFYwell.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."NOTiFYwell.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "NOTiFYwell.ear"
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
    at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
    at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
    at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.ogm.jpa.HibernateOgmPersistence' not found
    at org.jboss.as.jpa@25.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:1001)
    at org.jboss.as.jpa@25.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1044)
    at org.jboss.as.jpa@25.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:139)
    at org.jboss.as.jpa@25.0.0.Final//org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
    at org.jboss.as.server@17.0.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
    ... 8 more

09:40:13,671 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "NOTiFYwell.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYwell.ear\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"NOTiFYwell.ear\"
    Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.ogm.jpa.HibernateOgmPersistence' not found"}}
09:40:13,672 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "NOTiFYwell.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYwell.ear\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"NOTiFYwell.ear\"
    Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.ogm.jpa.HibernateOgmPersistence' not found"}}
09:40:13,673 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "NOTiFYwell.ear" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYwell.ear\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"NOTiFYwell.ear\"
    Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.hibernate.ogm.jpa.HibernateOgmPersistence' not found"}}

2

Have upgraded to the new Namespace:

import javax.ejb.*;
import javax.persistence.*;

to:

import jakarta.ejb.*;
import jakarta.persistence.*;

I need to upgrade WildFly 25.0.0.Final 'module' on:

org/hibernate/ogm/5.4/
org/hibernate/ogm/internal
org/hibernate/ogm/jipijapa
org/hibernate/ogm/main
org/hibernate/ogm/mongodb 

etc. 'main' to:

Jakarta JPA API OGM

Could do more explanation of:

https://in.relation.to/2021/06/02/hibernate-orm-550-final-release/

so I can deploy on:

JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/Cellar/wildfly-as/wildfly-preview-25.0.0.Final
JAVA: /Library/Java/JavaVirtualMachines/jdk17.0.1.jdk/Contents/Home/bin/java
NOTiFY
  • 1,255
  • 1
  • 20
  • 36
  • Are you including Hibernate Search in your deployment? – James R. Perkins Oct 20 '21 at 15:38
  • In Gradle: providedCompile "org.hibernate:hibernate-search-orm:5.11.10.Final". With & works with wildfly-25.0.0.Final. – NOTiFY Oct 20 '21 at 16:13
  • How are you installing or providing hibernate-ogm? The only dependency you show is for `hibernate-search-orm` and `hibernate-ogm` is not provided in WildFly by default. – James R. Perkins Oct 20 '21 at 20:06
  • In every new version of WildFly I create "modules/org/hibernate/ogm" & add: 5.4 ->, internal->, jipijapa->, main->, mongodb-> etc. Do I have to ensure I'm using the latest version of OGM for Jakarta? – NOTiFY Oct 20 '21 at 21:46
  • Ah well that's going to be a bit more difficult with preview then since during the build of preview it transforms all the `javax` namespaces to `jakarta` namespaces. – James R. Perkins Oct 20 '21 at 22:28
  • Sorry, I forgot a link. You might find this interesting https://lists.jboss.org/archives/list/wildfly-dev@lists.jboss.org/thread/LF7CZSONQQEX2DYCJOV4QGSKGCURMGKT/. – James R. Perkins Oct 20 '21 at 23:23

0 Answers0