4 Replies Latest reply on Feb 3, 2019 4:16 AM by ahmed galal

    Wildfly provision fail on windows

    ahmed galal Newbie

      Good day


      I am trying to build a "thin" provision version on my machine using gradle and  wildfly-build-provision plugin.
      The task downloads the necessary jar files and build the server in build/provision-wildfly , but the server fails to start because of failing to resolve modules.

      The jar files are already downloaded inside the ~/.m2 and when building a "fat" version of the server with all the required jars it starts normally.

      i am using windows 7 professional and tried wildfly 9 , 11 and 15 , and they all have the same problem.


      it seems that the thin version is not configured to read from my local maven repository -or any maven repository-.
      any suggestions to fix this ?

      Calling "D:\J2EE\SampleEJBWorkspace\TestJEEGradle\build\provisioned-wildfly\bin\standalone.conf.bat"
      Setting JAVA property to "C:\Program Files\Java\jdk1.8.0_131\bin\java"
        JBoss Bootstrap Environment
        JBOSS_HOME: "D:\J2EE\SampleEJBWorkspace\TestJEEGradle\build\provisioned-wildfly"
        JAVA: "C:\Program Files\Java\jdk1.8.0_131\bin\java"
        JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman"
      Exception in thread "main" org.jboss.modules.ModuleLoadException: Error loading module from D:\J2EE\SampleEJBWorkspace\TestJEEGradle\build\provisioned-wildfly\modules\system\layers\base\org\apache\xerces\main\module.xml
              at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:298)
              at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:254)
              at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:215)
              at org.jboss.modules.LocalModuleFinder.parseModuleXmlFile(LocalModuleFinder.java:255)
              at org.jboss.modules.LocalModuleFinder.lambda$findModule$1(LocalModuleFinder.java:198)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:198)
              at org.jboss.modules.ModuleLoader.findModule0(ModuleLoader.java:684)
              at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:677)
              at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:487)
              at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:390)
              at org.jboss.modules.Module.addPaths(Module.java:1203)
              at org.jboss.modules.Module.link(Module.java:1573)
              at org.jboss.modules.Module.relinkIfNecessary(Module.java:1601)
              at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:287)
              at org.jboss.modules.Main.main(Main.java:399)
      Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'xerces:xercesImpl:2.11.0.SP5' (position: END_TAG seen ...resources>\n        ... @26:56)
              at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:953)
              at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:854)
              at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:645)
              at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:416)
              at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:296)
              ... 15 more
      Press any key to continue . . .
        • 1. Re: Wildfly provision fail on windows
          Jaikiran Pai Master

          ahmed_galal  wrote:


          Good day


          I am trying to build a "thin" provision version on my machine using gradle and  wildfly-build-provision plugin.

          I wasn't aware that there's such a plugin. I have no experience with this one but having now checked it's source repo on github, maybe sannegrinovero might be able to help?

          • 2. Re: Wildfly provision fail on windows
            ahmed galal Newbie

            thanks for your reply jaikiran ,

            I actually wanted to know how the modules and the provision servers resolve its dependencies and how to configure its repositories.

            • 3. Re: Wildfly provision fail on windows
              Tomaž Cerar Master

              error you see could be related to jboss-modules not beeing able to resolve dependancies from maven.


              it tries to look at your user's .m2/settings.xml if you have some special info for local repository

              and any special remote repositories you are using.


              I would start at looking at what kind of maven settings are there.

              By default it just tries to use jboss.org maven repo to download stuff and run the server.


              you can tell him what kind of local / remote repo to use by passing -Dmaven.repo.local=... and -Dremote.maven.repo=..



              for more see jboss-modules/MavenSettings.java at 1.x · jboss-modules/jboss-modules · GitHub

              • 4. Re: Wildfly provision fail on windows
                ahmed galal Newbie

                Thanks a lot Tomaz , and sorry for the late reply!
                My .m2 folder didn't have settings.xml to start with , so i tried creating the settings.xml and adding the nexus repository  to the it , and it worked!

                         <name>your custom repo</name>

                It is also worth mentioning that the server still works even after removing the settings.xml file from the repository.
                i think this means there was some missing dependencies and they were downloaded by the server when the settings.xml existed.
                I don't know if that is considered a bug , but the server should have given a clear error if it didn't find the settings.xml , or it at least should have a  default repository to work with.