Error org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-core}


#1

Hi Guys,

I am new in this kind of development and I have troubles to make my OGM (mongoDB) works.
I followed this tutorial https://docs.jboss.org/hibernate/stable/ogm/reference/en-US/html_single/#_how_to_build_support_for_a_data_store
but I get an error when I deploy my component on a Wildfly 14 server.

15:57:37,540 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.module.service.“deployment.mongo.war”.main: org.jboss.msc.service.StartException in service jboss.module.service.“deployment.mongo.war”.main: WFLYSRV0179: Failed to load module: deployment.mongo.war
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:89)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from J:\Development\Applications\Servers\wildfly-14.8\wildfly-14.0.1.Final\modules\system\layers\base\org\hibernate\ogm\5.4\module.xml
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:313)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:269)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:230)
at org.jboss.modules.LocalModuleFinder.parseModuleXmlFile(LocalModuleFinder.java:250)
at org.jboss.modules.LocalModuleFinder.lambda$findModule$1(LocalModuleFinder.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:195)
at org.jboss.modules.ModuleLoader.findModule0(ModuleLoader.java:693)
at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:686)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:496)
at org.jboss.modules.DelegatingModuleLoader.preloadModule(DelegatingModuleLoader.java:57)
at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:411)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:452)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:144)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:397)
at org.jboss.modules.Module.addPaths(Module.java:1252)
at org.jboss.modules.Module.link(Module.java:1622)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:66)
… 8 more
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '{org.hibernate.ogm:hibernate-ogm-core}' (position: END_TAG seen ... <artifact name="{org.hibernate.ogm:hibernate-ogm-core}"/>… @11:67) caused by: java.lang.IllegalArgumentException: {org.hibernate.ogm:hibernate-ogm-core} at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1024) at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:910) at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:679) at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:440) at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:311) ... 28 more Caused by: java.lang.IllegalArgumentException: {org.hibernate.ogm:hibernate-ogm-core}
at org.jboss.modules.maven.ArtifactCoordinates.fromString(ArtifactCoordinates.java:83)
at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1020)
… 32 more

here my Jboss-deployment-structure file










my server-provisioning is defined in this way

    <feature-pack
        groupId="org.hibernate.ogm"
        artifactId="hibernate-ogm-featurepack-infinispan-remote"
        version="5.4.1.Final" /> 

    <feature-pack
        groupId="org.hibernate.ogm"
        artifactId="hibernate-ogm-featurepack-infinispan-embedded"
        version="5.4.1.Final" /> 

    <feature-pack
        groupId="org.hibernate.ogm"
        artifactId="hibernate-ogm-featurepack-mongodb"
        version="5.4.1.Final" /> 

    <feature-pack
        groupId="org.hibernate.ogm"
        artifactId="hibernate-ogm-featurepack-neo4j"
        version="5.4.1.Final" /> 

    <feature-pack
        groupId="org.hibernate.ogm"
        artifactId="hibernate-ogm-featurepack-core"
        version="5.4.1.Final" />
</feature-packs>

My persistence file is defined in this way



org.hibernate.ogm.jpa.HibernateOgmPersistence









the following feature package are unpacked in my server side: …\modules\system\layers\base\org\hibernate\ogm

hibernate-ogm-featurepack-core-5.4.1.Final
hibernate-ogm-featurepack-infinispan-remote-5.4.1.Final
hibernate-ogm-featurepack-infinispan-embedded-5.4.1.Final
hibernate-ogm-featurepack-mongodb-5.4.1.Final
hibernate-ogm-featurepack-neo4j-5.4.1.Final

did I missed something?

thanks for your help

regards
DHS


#2

Hi,
feature packs are different than modules. You don’t have to unpack them the way you did.

I an project you can use as an example on my resporitory:

This is the folder with the project: https://github.com/DavideD/hibernate-demos/tree/prova/hibernate-ogm/nosql-with-hibernate-ogm-101/hibernate-ogm-demo-nosql-with-hibernate-ogm-101-part-3

Go to the folder and run:

 mvn clean install -s settings-example.xml

This will download and configure a WildFly instance in the folder:

target/wildfly-14.0.1.Final/

The build downloads the feature packs contained in the file server-provisioning.xml and export them in the server in the right way.

After that, you can copy the generated server somewhere else and use it or you can copy the configuration of the project and re-generate the server every time you build your projects.

Let me know if this doesn’t help.

Cheers