ModuleNotFoundException: org.hibernate.search.orm:5.10.4.Final

I trying to upgrade from JBoss WildFly 13.0.0.Final to 14.0.0.Final using OGM on MongoDB.

I’m getting an error:

Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate.search.orm:5.10.4.Final

In the feature pack reference in the documentation:

The feature pack is published on the JBoss Nexus repository and Maven Central as org.hibernate:hibernate-search-jbossmodules-engine:5.10.4.Final:zip.

I download this as a zip flle but there is no 5,10.4.Final.JAR is included.

Where do I get the 5.10.4 Search from?

What am I missing?

You should not use Hibernate Search 5.10.4.Final for now: we released it, so the documentation now refers to that version, but Maven Central is having trouble syncing its artifacts, so for now Search 5.10.4.Final is not available on Central. We hope it will get fixed soon, but don’t have any idea when, and have no control over it, unfortunately…

EDIT: you can use 5.10.3.Final safely with WildFly 14, you just won’t benefit from the latest bug fixes.

Regarding the fact that the ZIP does not contain any JAR: starting with Hibernate Search 5.9, we’re using feature packs instead of plain module ZIPs. This means the distribution ZIP only contains the feature pack, which is essentially instructions to build a set of modules from Maven artifacts which some tool will download automatically.

You will have to use that feature pack to generate a Wildfly instance. How to do it is described in the documentation.

Many thanks, That’s clear.

So the Maven Artifacts will create the appropriate folders in the modules on my WildFly 14 instance for the search?

As explained in the documentation:

Gradle users can use the org.wildfly.build.provision plugin, available on the official Gradle plugin portal.

The sync finally happened: Hibernate Search 5.10.4.Final is now available on Maven Central :slight_smile:

Using Gradle I have provisioned WildFly 14.0.0.Final in:

/build/provisioned-wildfly/ …

However a number of things are confusing me.

Do I need to put the file ‘wildfly-feature-pack.xml’ in my root and reference it from the Gradle Build:

// Provision WildFly 14.0.0.Final
provision {
    variables['wildfly.version'] = '14.0.0.Final'

    configuration = file( 'wildfly-feature-pack.xml' )
}

And do I have to add an ‘override’

// Provision WildFly 14.0.0.Final
provision {
    variables['wildfly.version'] = '14.0.0.Final'

    //  Hibernate Search 5.10.4
    override( 'org.hibernate.search.orm:5.10.4.Final' ) {
        groupId = 'org.hibernate'
        artifactId = 'hibernate-search-jbossmodules-engine'
        version = '5.10.4'
    }
    configuration = file( 'wildfly-feature-pack.xml' )
}

A Gradle example to add the 5.10.4 search in the documentation would be useful :slight_smile:

However a number of things are confusing me.

Let’s ask the author of the Wildfly Gradle Tools: @Sanne, any idea?

A Gradle example to add the 5.10.4 search in the documentation would be useful :slight_smile:

Probably… The thing is, we don’t use Gradle in Hibernate Search, so we don’t really follow the evolution of Gradle. So any Gradle example would likely get out of date without any of the active contributors to Hibernate Search knowing. Then the example would become misleading, which is arguably worse than having to find an up-to-date example elsewhere.

But I guess we can always try to add a warning to the example, stating which version of Gradle we’re talking about. @Sanne, WDYT? Could you add that?

You may have found that out yourself, since you withdrawn your post, I’ll provide an answer just in case you still need help. I’m answering to your question at https://developer.jboss.org/message/985312#985312.

The Gradle provisioning plugin does not expect a feature pack as an input. It expect a server provisioning configuration, which itself lists one or several feature packs (plus some more advanced configuration if necessary, but you probably don’t need that). That’s what this section of the documentation is about.

As I said before, I’m not very familiar with Gradle, so I just followed the instructions in the Gradle plugin’s documentation and Hibernate Search’s documentation. Here are two files that make things work:

build.gradle:

plugins {
  id "org.wildfly.build.provision"   version '0.0.9'
}

repositories {
        mavenLocal()
        mavenCentral()
        maven {
                name 'jboss-nexus'
                url "http://repository.jboss.org/nexus/content/groups/public/"
        }
}

provision {
        //Optional destination directory:
        destinationDir = file("wildfly-custom")

        configuration = file( 'wildfly-server-provisioning.xml' )

        //Define variables which need replacing in the provisioning configuration!
        variables['wildfly.version'] = '14.0.0.Final'
        variables['hibernate-search.version'] = '5.10.4.Final'
}

server-provisioning.xml:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
        <feature-packs>
                <feature-pack
                                groupId="org.wildfly"
                                artifactId="wildfly-feature-pack"
                                version="${wildfly.version}" />
                <feature-pack
                                groupId="org.hibernate"
                                artifactId="hibernate-search-jbossmodules-orm"
                                version="${hibernate-search.version}" />
        </feature-packs>
</server-provisioning>

Running “gradle provision” with this configuration created a Wildfly instance in the “wildfly-custom” folder.

That being said, if I understood correctly, you were trying to upgrade Hibernate OGM to begin with. I suppose, since you are trying to use Hibernate Search 5.10.4 and not 5.9, that you wanted to use Hibernate OGM 5.4 (which, friendly reminder, is still in Beta).

If so, I’d advise you to try Hibernate Search 5.10.2.Final first (since it’s the version targeted by ORM 5.4.0.Beta2).

Then the build.gradle becomes this (just change the Hibernate Search version and add one variable for the OGM version):

plugins {
  id "org.wildfly.build.provision"   version '0.0.9'
}

repositories {
        mavenLocal()
        mavenCentral()
        maven {
                name 'jboss-nexus'
                url "http://repository.jboss.org/nexus/content/groups/public/"
        }
}

provision {
        //Optional destination directory:
        destinationDir = file("wildfly-custom")

        configuration = file( 'wildfly-server-provisioning.xml' )

        //Define variables which need replacing in the provisioning configuration!
        variables['wildfly.version'] = '14.0.1.Final'
        variables['hibernate-search.version'] = '5.10.2.Final'
        variables['hibernate-ogm.version'] = '5.4.0.Beta2'
}

… And the server-provisioning.xml becomes this:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
        <feature-packs>
                <feature-pack
                                groupId="org.wildfly"
                                artifactId="wildfly-feature-pack"
                                version="${wildfly.version}" />
                <feature-pack
                                groupId="org.hibernate"
                                artifactId="hibernate-search-jbossmodules-orm"
                                version="${hibernate-search.version}" />
                <feature-pack
                                groupId="org.hibernate.ogm"
                                artifactId="hibernate-ogm-featurepack-mongodb"
                                version="${hibernate-ogm.version}" />
        </feature-packs>
</server-provisioning>

Note that if you need the JARs to be copied to your Wildfly directory (e.g. to copy it in a production environment), you can add the “copy-module-artifacts” attribute to the server provisioning file:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1" copy-module-artifacts="true">
        <feature-packs>
        ...

Finally, if you really want Search 5.10.4.Final, you can try to change the version in your build.gradle, and then use this trick to force WildFly to use the version you chose.

If it doesn’t work, there may be some subtelty when using OGM, and then I’m afraid you’ll need someone else, as I’m not overly familiar with the override mechanism in the wildfly-provisioning-plugin, nor with how OGM integrates with Search. @Sanne may help you when he comes back, otherwise you can try the Wildfly community (again).

Many thanks for that. I did make some progress.

I finally realised Gradle “does not expect a feature pack as an input. It expects a server provisioning”. Hence the deletion.

Your instructions have helped me move on, Though it can’t find:

variables[‘hibernate-ogm.version’] = ‘5.4.0.Beta2.Final’

<feature-pack
groupId=“org.hibernate.ogm”
artifactId=“hibernate-ogm-featurepack-mongodb”
version=“${hibernate-ogm.version}”

Changed version to:

variables[‘hibernate-ogm.version’] = ‘5.4.0.Beta2’

And it can’t find that either. Though it is listed in Central:

Hibernate OGM For MongoDB » 5.4.0.Beta2

To test I added to my Gradle build:

compile group: 'org.hibernate.ogm', name: 'hibernate-ogm-mongodb', version: '5.4.0.Beta2'

It finds it okay.

  • What went wrong:
    Execution failed for task ‘:provision’.

Could not resolve all files for configuration ‘:detachedConfiguration14’.
Could not find hibernate-ogm-mongodb.zip (org.hibernate.ogm:hibernate-ogm-mongodb:5.4.0.Beta2).
Searched in the following locations:
https://repo.maven.apache.org/maven2/org/hibernate/ogm/hibernate-ogm-mongodb/5.4.0.Beta2/hibernate-ogm-mongodb-5.4.0.Beta2.zip

Just saw your message; I recommend posting a new message instead of editing your message next time, because we don’t get notified when you simply edit a message.

I edited my post, the 5.4.0.Beta2 was indeed a typo.

Anyway, let’s cut the chase. Here is Gradle project that just works: https://ufile.io/qjxsz Unzip, go to the extracted directory, execute gradle provision, and voilà.

Content of this ZIP for the record:

build.gradle:

plugins {
  id "org.wildfly.build.provision"   version '0.0.9'
}

repositories {
        mavenLocal()
        mavenCentral()
        maven {
                name 'jboss-nexus'
                url "http://repository.jboss.org/nexus/content/groups/public/"
        }
}

provision {
        //Optional destination directory:
        destinationDir = file("wildfly-custom")

        configuration = file( 'wildfly-server-provisioning.xml' )

        //Define variables which need replacing in the provisioning configuration!
        variables['wildfly.version'] = '14.0.1.Final'
        variables['hibernate-search.version'] = '5.10.4.Final'
        variables['hibernate-ogm.version'] = '5.4.0.CR1'
}

wildfly-server-provisioning.xml:

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1" copy-module-artifacts="true">
        <feature-packs>
                <feature-pack
                        groupId="org.wildfly"
                        artifactId="wildfly-feature-pack"
                        version="${wildfly.version}" />

                <feature-pack
                    groupId="org.hibernate"
                    artifactId="hibernate-search-jbossmodules-orm"
                    version="${hibernate-search.version}" />

                <feature-pack
                                groupId="org.hibernate.ogm"
                                artifactId="hibernate-ogm-featurepack-mongodb"
                                version="${hibernate-ogm.version}" />
        </feature-packs>
</server-provisioning>

Tested locally, I get a “wildfly-custom” directory containing a server with all I want: OGM 5.4.0.CR1, Search 5.10.4.Final, ORM 5.3.6.Final.

The contents of your ZIP file was almost exactly what I had:

variables[‘wildfly.version’] = ‘14.0.0.Final’
variables[‘hibernate-search.version’] = ‘5.10.4.Final’
variables[‘hibernate-ogm.version’] = ‘5.4.0.Beta2’

I changed to yours:

variables[‘wildfly.version’] = ‘14.0.1.Final
variables[‘hibernate-search.version’] = ‘5.10.4.Final’
variables[‘hibernate-ogm.version’] = ‘5.4.0.CR1

When I run:

gradle provision

I still get:

Task :provision FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 0s
1 actionable task: 1 executed

***** UPDATE *****

Copied your gradle.build & wildfly-server-provisioning.xml from the exploded ZIP and that can ‘provision’, when it’s run as a ‘stand-alone’ Gradle Task.

However it just doesn’t work if the ‘provisioning’ is part of my main/complete gradle.build.

Thanks very much for your efforts and help.