Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-92

Running mvn wildfly-swarm:run fails in Docker container

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.Alpha6
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I am attempting to run mvn wildfly-swarm:run from inside a Docker container, but it fails with the following message: Error loading module from modules/org/jboss/invocation/main/module.xml.

      It works from both terminal and IntelliJ. I am using the 1.0.0.Alpha3 version.

      When I try to do mvn package I get a the following stacktrace:

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      [INFO] Packaging webapp
      [INFO] Assembling webapp [altinn-mock] in [/source/target/altinn-mock]
      [INFO] Processing war project
      [INFO] Webapp assembled in [63 msecs]
      [INFO] Building war: /source/target/altinn-mock.war
      [INFO] 
      [INFO] --- wildfly-swarm-plugin:1.0.0.Alpha3:create (default) @ altinn-mock ---
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-plugin-api/3.2.5/maven-plugin-api-3.2.5.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-plugin-api/3.2.5/maven-plugin-api-3.2.5.pom (3 KB at 64.3 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven/3.2.5/maven-3.2.5.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven/3.2.5/maven-3.2.5.pom (22 KB at 809.1 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-parent/25/maven-parent-25.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-parent/25/maven-parent-25.pom (37 KB at 731.2 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/apache/15/apache-15.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/apache/15/apache-15.pom (15 KB at 676.3 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-model/3.2.5/maven-model-3.2.5.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-model/3.2.5/maven-model-3.2.5.pom (5 KB at 188.5 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.pom (4 KB at 82.7 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-artifact/3.2.5/maven-artifact-3.2.5.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/apache/maven/maven-artifact/3.2.5/maven-artifact-3.2.5.pom (3 KB at 99.7 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.pom (5 KB at 124.2 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/sisu-plexus/0.3.0.M1/sisu-plexus-0.3.0.M1.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/sisu-plexus/0.3.0.M1/sisu-plexus-0.3.0.M1.pom (13 KB at 646.9 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.pom (3 KB at 103.8 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/sisu-inject/0.3.0.M1/sisu-inject-0.3.0.M1.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/sisu-inject/0.3.0.M1/sisu-inject-0.3.0.M1.pom (14 KB at 398.8 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.pom
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.pom (5 KB at 222.3 KB/sec)
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.jar
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.jar
      Downloading: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.jar
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.jar (196 KB at 3108.9 KB/sec)
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.jar (240 KB at 3677.4 KB/sec)
      Downloaded: http://mvnrepo/nexus/content/groups/Alle/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.jar (333 KB at 4814.7 KB/sec)
      Jul 03, 2015 12:11:43 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
      WARNING: Error injecting: org.wildfly.swarm.plugin.CreateMojo
      java.lang.NoClassDefFoundError: org/eclipse/aether/RepositorySystemSession
      
      ..........
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 17.603s
      [INFO] Finished at: Fri Jul 03 12:11:43 UTC 2015
      [INFO] Final Memory: 19M/182M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.wildfly.swarm:wildfly-swarm-plugin:1.0.0.Alpha3:create (default) on project altinn-mock: Execution default of goal org.wildfly.swarm:wildfly-swarm-plugin:1.0.0.Alpha3:create failed: A required class was missing while executing org.wildfly.swarm:wildfly-swarm-plugin:1.0.0.Alpha3:create: org/eclipse/aether/RepositorySystemSession
      [ERROR] -----------------------------------------------------
      [ERROR] realm =    plugin>org.wildfly.swarm:wildfly-swarm-plugin:1.0.0.Alpha3
      [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      [ERROR] urls[0] = file:/root/.m2/repository/org/wildfly/swarm/wildfly-swarm-plugin/1.0.0.Alpha3/wildfly-swarm-plugin-1.0.0.Alpha3.jar
      [ERROR] urls[1] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.jar
      [ERROR] urls[2] = file:/root/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.0.M1/org.eclipse.sisu.plexus-0.3.0.M1.jar
      [ERROR] urls[3] = file:/root/.m2/repository/javax/enterprise/cdi-api/1.2/cdi-api-1.2.jar
      [ERROR] urls[4] = file:/root/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
      [ERROR] urls[5] = file:/root/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0.M1/org.eclipse.sisu.inject-0.3.0.M1.jar
      [ERROR] urls[6] = file:/root/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
      [ERROR] Number of foreign imports: 1
      [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
      [ERROR] 
      [ERROR] -----------------------------------------------------: org.eclipse.aether.RepositorySystemSession
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
      

      `
      My pom.xml plugin configuration is like:

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
                  <plugin>
                      <groupId>org.wildfly.swarm</groupId>
                      <artifactId>wildfly-swarm-plugin</artifactId>
                      <version>${version.wildfly-swarm}</version>
                      <configuration>
                          <mainClass>no.husbanken.altinn.SwarmMain</mainClass>
                      </configuration>
                      <executions>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>create</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
      

      `

      I also get an error running java -jar my-jar-swarm.jar after mvn package from the terminal outside of docker.

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      $ java -jar target/altinn-mock-15.6-SNAPSHOT-swarm.jar 
      Exception in thread "main" java.lang.ClassNotFoundException: org.wildfly.swarm.Swarm from [Module "org.wildfly.swarm.bootstrap:main" from BootModuleLoader@531d72ca for finders [org.wildfly.swarm.bootstrap.modules.BootstrapClasspathModuleFinder@22d8cfe0, org.wildfly.swarm.bootstrap.modules.BootstrapModuleFinder@579bb367, org.wildfly.swarm.bootstrap.modules.ClasspathModuleFinder@1de0aca6, org.wildfly.swarm.bootstrap.modules.AppDependenciesModuleFinder@255316f2]]
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      	at org.wildfly.swarm.bootstrap.Main.main(Main.java:51)
      

      `

      It seems as the plugin does not set the correct Main class as configured.

      Btw. my Dockerfile looks like this:

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      FROM java:8
      
      # Installerer maven
      RUN apt-get update \
        && apt-get install -y --no-install-recommends maven
      
      WORKDIR /source
      
      ADD settings.xml /home/root/.m2/
      
      ADD pom.xml     /source/pom.xml
      RUN mvn install
      
      ADD src/         /source/src/
      ADD data/        /source/data/
      
      RUN mvn package
      # RUN mvn wildfly-swarm:run
      

      `

      As a sidenote, I love Swarm and it's potential. Great job you are doing.

      UPDATE: I upped Maven to version 3.3 (had 3.0.5).

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      FROM java:openjdk-8-jdk
      
      ENV MAVEN_VERSION 3.3.3
      
      RUN curl -fsSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \
        && mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
        && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
      
      ENV MAVEN_HOME /usr/share/maven
      WORKDIR /source
      
      ADD settings.xml /home/root/.m2/
      ADD pom.xml     /source/pom.xml
      RUN mvn install
      
      ADD src/         /source/src/
      ADD data/        /source/data/
      # just making sure alle files are readable (even though I am root)
      RUN chmod 777       /home/root/.m2/
      RUN chmod 777       /source/src/
      RUN chmod 777       /source/data/
      RUN chmod 777       /source/target/altinn-mock.war
      
      RUN mvn wildfly-swarm:run -DskipTests
      

      `
      This is now the exception coming from the build inside docker:

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Exception in thread "main" org.jboss.modules.ModuleLoadError: Error loading module from modules/org/jboss/invocation/main/module.xml
      	at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:74)
      	at org.jboss.modules.Module.getPathsUnchecked(Module.java:1384)
      	at org.jboss.modules.Module.loadModuleClass(Module.java:555)
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      	at org.wildfly.swarm.runtime.container.RuntimeServer.<init>(RuntimeServer.java:44)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
      	at java.lang.Class.newInstance(Class.java:442)
      	at org.wildfly.swarm.container.Container.createServer(Container.java:85)
      	at org.wildfly.swarm.container.Container.<init>(Container.java:51)
      	at org.wildfly.swarm.Swarm.main(Swarm.java:25)
      Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'org.jboss.invocation:jboss-invocation:1.4.1.Final' (position: END_TAG seen ...rtifact name="org.jboss.invocation:jboss-invocation:1.4.1.Final"/>... @32:77) 
      	at org.jboss.modules.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:756)
      	at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:650)
      	at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:446)
      	at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:261)
      	at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:148)
      	at org.jboss.modules.ModuleXmlParserBridge.parseModuleXml(ModuleXmlParserBridge.java:17)
      	at org.wildfly.swarm.bootstrap.modules.BootstrapClasspathModuleFinder.findModule(BootstrapClasspathModuleFinder.java:35)
      	at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:452)
      	at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:355)
      	at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:302)
      	at org.jboss.modules.Module.addPaths(Module.java:1028)
      	at org.jboss.modules.Module.link(Module.java:1398)
      	at org.jboss.modules.Module.getPaths(Module.java:1359)
      	at org.jboss.modules.Module.getPathsUnchecked(Module.java:1382)
      	... 15 more
      

      `

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andtho Thomas Andersen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: