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

      I'm getting the following strange exception when launching the swarm JAR built from example-jaxrs.

      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
      22:37:43,923 ERROR [stderr] (main) Caused by: org.jboss.modules.ModuleLoadError: Error loading module from modules/system/layers/base/org/picketbox/main/module.xml                                                                                                                                                     
      22:37:43,923 ERROR [stderr] (main)      at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:74)                                       
      22:37:43,923 ERROR [stderr] (main)      at org.jboss.modules.Module.getPathsUnchecked(Module.java:1384)                                                     
      22:37:43,923 ERROR [stderr] (main)      at org.jboss.modules.Module.loadModuleClass(Module.java:555)                                                        
      22:37:43,924 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)                                        
      22:37:43,924 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)                
      22:37:43,924 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      22:37:43,924 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      22:37:43,925 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      22:37:43,925 ERROR [stderr] (main)      at java.lang.ClassLoader.defineClass1(Native Method)
      22:37:43,925 ERROR [stderr] (main)      at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      22:37:43,925 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353)
      22:37:43,926 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432)
      22:37:43,926 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269)
      22:37:43,926 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
      22:37:43,926 ERROR [stderr] (main)      at org.jboss.modules.Module.loadModuleClass(Module.java:560)
      22:37:43,927 ERROR [stderr] (main)      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
      22:37:43,927 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
      22:37:43,927 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
      22:37:43,928 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
      22:37:43,928 ERROR [stderr] (main)      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)
      22:37:43,928 ERROR [stderr] (main)      at java.lang.Class.forName0(Native Method)
      22:37:43,928 ERROR [stderr] (main)      at java.lang.Class.forName(Class.java:278)
      22:37:43,928 ERROR [stderr] (main)      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:363)
      22:37:43,929 ERROR [stderr] (main)      at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
      22:37:43,929 ERROR [stderr] (main)      at org.jboss.as.server.ApplicationServerService.service(ApplicationServerService.java:224)
      22:37:43,929 ERROR [stderr] (main)      at org.jboss.as.server.ApplicationServerService.start(ApplicationServerService.java:153)
      22:37:43,930 ERROR [stderr] (main)      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      22:37:43,930 ERROR [stderr] (main)      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      22:37:43,930 ERROR [stderr] (main)      ... 3 more
      22:37:43,930 ERROR [stderr] (main) Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact '${org.picketbox:picketbox}' (position: END_TAG seen ...<resources>\n        <artifact name="${org.picketbox:picketbox}"/>... @32:54) 
      22:37:43,931 ERROR [stderr] (main)      at org.jboss.modules.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:890)
      22:37:43,931 ERROR [stderr] (main)      at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:729)
      22:37:43,931 ERROR [stderr] (main)      at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:494)
      22:37:43,931 ERROR [stderr] (main)      at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:287)
      22:37:43,932 ERROR [stderr] (main)      at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:150)
      22:37:43,932 ERROR [stderr] (main)      at org.jboss.modules.BootModuleFinder.findModule(BootModuleFinder.java:48)
      22:37:43,932 ERROR [stderr] (main)      at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:452)
      22:37:43,932 ERROR [stderr] (main)      at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:355)
      22:37:43,932 ERROR [stderr] (main)      at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:302)
      22:37:43,933 ERROR [stderr] (main)      at org.jboss.modules.Module.addPaths(Module.java:1028)
      22:37:43,933 ERROR [stderr] (main)      at org.jboss.modules.Module.link(Module.java:1398)
      22:37:43,933 ERROR [stderr] (main)      at org.jboss.modules.Module.getPaths(Module.java:1359)
      22:37:43,933 ERROR [stderr] (main)      at org.jboss.modules.Module.getPathsUnchecked(Module.java:1382)
      22:37:43,934 ERROR [stderr] (main)      ... 29 more
      

      `
      The funny thing is, the problem depends on the machine or some environment conditions and is related to the order of the resources in the JAR.

      I'm using Maven 3.1.1 and Java 1.7.0_80 on two different machines running Ubuntu 12.04 and 14.04 respectively. Let's call the build results from the two machines good.jar and bad.jar.

      I can launch good.jar on both machines, bad.jar produces the same error on both machines.

      Unzipping the two JARs and diffing the contents yields no significant differences.

      good.jar entries come in the following order:

      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
      META-INF/MANIFEST.MF
      modules/system/layers/base/javax/security/jacc/api/main/module.xml
      ...
      m2repo/commons-io/commons-io/2.4/commons-io-2.4.jar
      ...
      XPP3-LICENSE.txt
      wildfly-boot.properties
      __redirected/__SAXParserFactory.class
      ...
      schema/module-1_0.xsd
      schema/module-1_2.xsd
      schema/module-1_3.xsd
      schema/module-1_1.xsd
      app/wildfly-swarm-example-jaxrs-1.0.0.Beta1-SNAPSHOT.war
      org/jboss/modules/IdentityHashSet.class
      ...
      

      `

      The order in bad.jar is:

      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
      META-INF/MANIFEST.MF
      wildfly-boot.properties
      app/wildfly-swarm-example-jaxrs-1.0.0.Beta1-SNAPSHOT.war
      __redirected/__RedirectedUtils.class
      ...
      XPP3-LICENSE.txt
      org/jboss/modules/AbstractResourceLoader.class
      ...
      org/wildfly/swarm/bootstrap/Main.class
      modules/system/layers/base/javax/activation/api/main/module.xml
      ...
      m2repo/commons-codec/commons-codec/1.9/commons-codec-1.9.jar
      ...
      

      `

      Unjarring bad.jar and re-jarring it with an explicit file list in the order from good.jar, I get a new JAR which also works.

      So the questions are:

      • Why does the order of JAR entries make a difference?
      • What causes the JAR entry order to be different on two machines?
      • Is this a bug in JBoss Modules, or in WildFly Swarm, or in Maven?
      • Is there a way to enforce a deterministic order?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hwellmann Harald Wellmann
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: