Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37797

Sporadic NoClassDefFoundError WebjarsVersion$Holder

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core, maven-plugin
    • None
    • OS: Linux amd64
      JRE: openjdk.x86_64 1.7.0 u55
      Jenkins 2.7.2
      Maven 3.3.1
      no slaves

      I'm using wicket-webjars in a maven multi-module project and for some reason all tests in a maven job in Jenkins fail from time to time (hard to reproduce) with a weird NoClassDefFoundError:

      java.lang.NoClassDefFoundError: Could not initialize class de.agilecoders.wicket.webjars.util.WebjarsVersion$Holder
      	at de.agilecoders.wicket.webjars.util.WebjarsVersion.useRecent(WebjarsVersion.java:46)
      	at de.agilecoders.wicket.webjars.request.resource.WebjarsCssResourceReference.<init>(WebjarsCssResourceReference.java:27)
      	at mycompany.MyBasePage.renderHead(MyBasePage.java:140)
      	at org.apache.wicket.Component.renderHead(Component.java:4489)
      	at org.apache.wicket.Component.internalRenderHead(Component.java:2715)
      	at org.apache.wicket.markup.renderStrategy.AbstractHeaderRenderStrategy.renderRootComponent(AbstractHeaderRenderStrategy.java:119)
      	at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:60)
      	at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:171)
      	at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2565)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1698)
      	at org.apache.wicket.Component.internalRender(Component.java:2380)
      	at org.apache.wicket.Component.render(Component.java:2308)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1524)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1759)
      	at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1734)
      	at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1657)
      	at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2565)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1698)
      	at org.apache.wicket.Component.internalRender(Component.java:2380)
      	at org.apache.wicket.Component.render(Component.java:2308)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1524)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1759)
      	at org.apache.wicket.Page.onRender(Page.java:879)
      	at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:141)
      	at org.apache.wicket.Component.internalRender(Component.java:2380)
      	at org.apache.wicket.Component.render(Component.java:2308)
      	at org.apache.wicket.Page.renderPage(Page.java:1018)
      	at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124)
      	at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:236)
      	at org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider$1.respond(BaseWicketTester.java:2747)
      	at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
      	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
      	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
      	at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:718)
      	at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:657)
      	at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:887)
      	at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:904)
      	at mycompany.MyTest.testWithWebjarsInvolved(MyTest.java:95)
      

      This does not happen on every build. It can even happen on one build and if I rebuild it immediately without any changes, then the build is fine. Also, the problem occurs only in Jenkins, it never happened on a local Maven build.

      Note that the class that cannot be loaded (WebjarsVersion$Holder) is in the same JAR as the class that wants to load it (WebjarsVersion) and I don't see any dependencies that could be missing (it's only "slf4j" and "wicket" and if they would be missing, the build would fail earlier).

      I already reported an issue at wicket-webjars and they just told me they have the same weird problem on their Cloudbees server and suspect it could be a problem with Jenkins class loading. So I'm hoping you might have a clue what's wrong here.

      Some more versions:
      Wicket 7.2.0
      wicket-webjars 0.5.3
      Junit 4.12

      Maven build options:
      -Xmx1024m -XX:MaxPermSize=512m
      -T 4 clean deploy

      The problem happened since we started using webjars. At that time we had much older versions of Jenkins, Maven & Wicket, so I think it doesn't really depend on a specific version.

      Thanks in advance,
      Sven

            Unassigned Unassigned
            svenackermann Sven Ackermann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: