8 Replies Latest reply on Feb 28, 2019 12:42 AM by zhurlik

    Wildfly 14

    david.sellier.dev

      Hi I have a small issue when I deploy my war on a wildfly 14 instance.

      It seems that wildfly cannot find a reference to a variable inside one of the module.xml (hibernate OGM) i.e. ${org.hibernate.ogm:hibernate-ogm-core}.

       

      I could not figure out where I should declare the value of the environment variable.

       

      14:09:25,845 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.module.service."deployment.MongoRest.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.MongoRest.war".main: WFLYSRV0179: Failed to load module: deployment.MongoRest.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

       

      my jboss-deployment-strcuture in my Web-inf is defined like this:

      <jboss-deployment-structure>

          <deployment>

              <dependencies>

                  <module name="org.hibernate.ogm" slot="5.4" services="export" />

                  <module name="org.hibernate.ogm.infinispan-remote" slot="5.4" services="export" />

                  <module name="org.hibernate.ogm.infinispan-embedded" slot="5.4" services="export" />

                  <module name="org.hibernate.ogm.mongodb" slot="5.4" services="export" />

                  <module name="org.hibernate.ogm.neo4j" slot="5.4" services="export" />

              </dependencies>

          </deployment>

      </jboss-deployment-structure>

       

      thanks for you help

       

      regards

      DHS

        • 1. Re: Wildfly 14
          lafr

          You added those modules to the WildFly 14 installation?

          What's the content of J:\Development\Applications\Servers\wildfly-14.8\wildfly-14.0.1.Final\modules\system\layers\base\org\hibernate\ogm\5.4\module.xml?

          Usually there are no variables in module.xml files.

           

          • 2. Re: Wildfly 14
            david.sellier.dev

            Hi Thanks for taking time to help me.

             

            here you have the module.xml.

             

            a écrit :

             

            JBoss Developer <https://developer.jboss.org/?et=watches.email.thread>

            Wildfly 14

             

            reply from Frank Langelage

            <https://developer.jboss.org/people/lafr?et=watches.email.thread> in

            WildFly - View the full discussion

            <https://developer.jboss.org/message/988120?et=watches.email.thread#988120>

             

            • 3. Re: Wildfly 14
              david.sellier.dev

              I followed this tutorial Hibernate OGM 5.4.1.Final: Reference Guide. I downloaded the feature packs here and installed them on my server (...\wildfly-14.0.1.Final\modules\system\layers\base\org\hibernate\ogm\...)

               

              <module xmlns="urn:jboss:module:1.3" name="org.hibernate.ogm" slot="5.4">

                  <resources>

                      <artifact name="${org.hibernate.ogm:hibernate-ogm-core}"/>

                  </resources>

                  <dependencies>

                      <module name="org.hibernate" export="true" slot="5.3" />

                      <module name="org.hibernate.commons-annotations" />

                      <module name="org.hibernate.hql" slot="1.5.0.Final" />

                      <module name="org.hibernate.search.orm" slot="main" optional="true" />

                      <module name="javax.persistence.api" />

                      <module name="javax.transaction.api" />

                      <module name="org.jboss.logging" />

                     <module name="org.hibernate.ogm.jipijapa" slot="5.4.1.Final" services="import" />

                      <!-- Needed for Iso8601StringDateType -->

                      <module name="javax.xml.bind.api"/>

                  </dependencies>

              </module>

              • 4. Re: Wildfly 14
                lafr

                There seems to be missing soemthing to replace ${org.hibernate.ogm:hibernate-ogm-core} with the concrete value.

                If you look into the folder where the module.xml file is located there should be a jar file named "hibernate-ogm-core-5.4.*.jar".

                Replace the variable in module.xml with the name of the jar file manually.

                 

                 

                • 5. Re: Wildfly 14
                  david.sellier.dev

                  Thanks Frank for helping me on this. 

                   

                  I downloaded all packages (e.g. org.hibernate.ogm, org.hibernate.ogm.infinispan-remote, org.hibernate.ogm.mongodb...) from Jboss nexus. The variable (${org.hibernate.ogm:hibernate-ogm-core} ) is set like this in each module.xml.

                  here an example of another module.xml (i.e. hibernate.hql).

                   

                  <module xmlns="urn:jboss:module:1.3" name="org.hibernate.hql" slot="1.5.0.Final">

                      <properties>

                          <property name="jboss.api" value="private"/>

                      </properties>

                      <resources>

                          <artifact name="${org.hibernate.hql:hibernate-hql-lucene}"/>

                          <artifact name="${org.hibernate.hql:hibernate-hql-parser}"/>

                          <artifact name="${org.antlr:antlr-runtime}"/>

                      </resources>

                      <dependencies>

                          <module name="org.hibernate.search.engine" optional="true" slot="main" />

                          <module name="org.jboss.logging"/>

                      </dependencies>

                  </module>

                   

                  I do not think I should manually create and resolve those dependencies manually. either there is a command from wildfly that allow me to resolve those dependencies (i read there is wildfly CLI and a commad "module") or either I need to create this structure as part of my war file and deploy it as part of my deployment package with wildfly

                  I thought by using a jboss-deployment-structure.xml file in mny war, jboss/wildlfy will resolve and get the different jar either fron nexus repository or either ./lib in my war. here my jboss-deployment-structure I have in my project

                   

                  <jboss-deployment-structure>

                      <deployment>

                          <dependencies>

                              <module name="org.hibernate.ogm" slot="5.4" services="export" />

                              <!-- <module name="org.hibernate.ogm.core" slot="5.4" services="export" /> -->

                              <module name="org.hibernate.ogm.infinispan-remote" slot="5.4" services="export" />

                              <module name="org.hibernate.ogm.infinispan-embedded" slot="5.4" services="export" />

                              <module name="org.hibernate.ogm.mongodb" slot="5.4" services="export" />

                              <module name="org.hibernate.ogm.neo4j" slot="5.4" services="export" />

                          </dependencies>

                      </deployment>

                  </jboss-deployment-structure>

                  • 6. Re: Wildfly 14
                    zhurlik

                    Hi,

                     

                    I have looked at xsd 1.3 for jboss modules and found

                     

                    <xsd:complexType name="artifactType">

                       <annotation xmlns="http://www.w3.org/2001/XMLSchema">

                       <documentation>

                      A maven artifact within a deployment.

                       </documentation>

                       </annotation>

                       <xsd:attribute name="name" type="xsd:string" use="required">

                       <annotation xmlns="http://www.w3.org/2001/XMLSchema">

                       <documentation>

                      URI that points to the maven artifact "group:artifact:version[:classifier]"

                       </documentation>

                       </annotation>

                       </xsd:attribute>

                    </xsd:complexType>

                     

                     

                    Maybe it means that you can not use ${}

                     

                    Thanks,

                    Vlad

                     

                    • 7. Re: Wildfly 14
                      lafr

                      Don't know what you did exactly.

                      Having a quick look at the manual regarding Hibernate OGM you referenced you should have created a maven project to add Hibernate OGM to a WildFly 14 release.

                       

                      The source files for the mdules can have placeholders like you can see here: wildfly/module.xml at master · wildfly/wildfly · GitHub .

                      During the build process those placeholders are getting replaced because of the given versions and dependencies.

                      The module.xml files used at runtime must not have placeholders.

                       

                      The purpose of jboss-deployment-structure.xml is only to make the classes of the deployed modules available to your application.

                      • 8. Re: Wildfly 14
                        zhurlik

                        Hmm... I see a small difference <module xmlns="urn:jboss:module:1.7" name="org.hibernate">

                        The second that I have found GitHub - wildfly/wildfly-build-tools: Wildfly build and provisioning tools

                        Looks like the placeholders will be replaced by wildfly maven plugin

                         

                        modules: contains module.xml files. These files should not use references, but should instead use references of the form:<artifact name="${org.hibernate:hibernate-core}"/>.These artifact references will be replaced by concrete references to a specific version or a reference when the server is provisioned. This makes it possible to override the version of specific artifacts at provisioning time. In addition, version numbers can be automatically added to module descriptors of version 1.6 or later by adding a version attribute whose argument is either a fixed version string or one of the given artifact references. The version number will appear on stack traces on Java 9 and later.