java.lang.NoSuchMethodError: groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class;

Jenkins JIRA | Guillaume Ménard | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [JIRA] (JENKINS-36434) Jigomerge, Jenkins 2, GroovyClassLoader.parseClass Fatal error

    Google Groups | 8 months ago | guillaum...@soprasteria.com (JIRA)
    java.lang.NoSuchMethodError: groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class;
  2. 0

    Running a simple jigomerge causes this error: {code:java} FATAL: groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class; java.lang.NoSuchMethodError: groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class; at hudson.plugins.jigomerge.JigomergeBuilder.perform(JigomergeBuilder.java:93) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) {code} This is is due to a modification in groovy where [the method parseClass(InputStream in) has been removed|http://docs.groovy-lang.org/latest/html/api/groovy/lang/GroovyClassLoader.html#parseClass(java.io.InputStream,%20java.lang.String)]: the easiest alternative would be to use {code:java} parseClass(String text) {code} or a deprecated function {code:java} parseClass(InputStream in, String fileName) {code} This modification has to be done in [JigomergeBuilder.java#L93|https://github.com/jenkinsci/jigomerge-plugin/blob/master/src/main/java/hudson/plugins/jigomerge/JigomergeBuilder.java#L93]. EDIT: We maybe could rather change [JigomergeBuilder.java#L90|https://github.com/jenkinsci/jigomerge-plugin/blob/master/src/main/java/hudson/plugins/jigomerge/JigomergeBuilder.java#L90]: {code:java} InputStream scriptResource = this.getClass().getResourceAsStream( "/scripts/jigomerge-" + JIGOMERGE_VERSION + ".groovy"); {code} to {code:java} File scriptResource = new File ("/scripts/jigomerge-" + JIGOMERGE_VERSION + ".groovy"); {code}.

    Jenkins JIRA | 8 months ago | Guillaume Ménard
    java.lang.NoSuchMethodError: groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class;

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      groovy.lang.GroovyClassLoader.parseClass(Ljava/io/InputStream;)Ljava/lang/Class;

      at hudson.plugins.jigomerge.JigomergeBuilder.perform()
    2. hudson.plugins.jigomerge
      JigomergeBuilder.perform
      1. hudson.plugins.jigomerge.JigomergeBuilder.perform(JigomergeBuilder.java:93)
      1 frame
    3. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      3. hudson.model.Build$BuildExecution.build(Build.java:205)
      4. hudson.model.Build$BuildExecution.doRun(Build.java:162)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      6. hudson.model.Run.execute(Run.java:1741)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:410)
      9 frames