org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/.../workflow-libs/src/chef/Cookbook.groovy: 5: Invalid duplicate class definition of class chef.Cookbook : The source file:/.../workflow-libs/src/chef/Cookbook.groovy contains at least two definitions of the class chef.Cookbook. One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name. @ line 5, column 1. class Cookbook { ^ 1 error

Jenkins JIRA | Jesse Glick | 2 years ago
  1. 0

    If a library includes syntax errors, the build pretends to start but cannot be killed: {code:none} Started by user anonymous ERROR: failed to start build org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/.../workflow-libs/src/chef/Cookbook.groovy: 5: Invalid duplicate class definition of class chef.Cookbook : The source file:/.../workflow-libs/src/chef/Cookbook.groovy contains at least two definitions of the class chef.Cookbook. One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name. @ line 5, column 1. class Cookbook { ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:861) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:346) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:314) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) {code} where the library starts {code} package chef; def script = this; class Cookbook { ... } {code}

    Jenkins JIRA | 2 years ago | Jesse Glick
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/.../workflow-libs/src/chef/Cookbook.groovy: 5: Invalid duplicate class definition of class chef.Cookbook : The source file:/.../workflow-libs/src/chef/Cookbook.groovy contains at least two definitions of the class chef.Cookbook. One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name. @ line 5, column 1. class Cookbook { ^ 1 error
  2. 0

    {code:none} {/* supposed to be a block but this is wrong */} {code} yields {code:none} ERROR: failed to start build org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 2: Ambiguous expression could be either a parameterless closure expression or an isolated open code block; solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 2, column 1. { ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:346) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:314) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) {code} but then the build is still shown as running, and the stop button does not work. Need to forcibly delete it.

    Jenkins JIRA | 2 years ago | Jesse Glick
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 2: Ambiguous expression could be either a parameterless closure expression or an isolated open code block; solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 2, column 1. { ^ 1 error
  3. 0

    I have a workflow project, for which I typed an error inte the Groovy script. When executing the build it then reports an error in the console and then hangs (doesn't terminate). This is the output in the build console: {noformat} Started by user Anders Hammar ERROR: failed to start build org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 4: unexpected char: '\' @ line 4, column 74. n.repo.local=.repository -s D:\Jenkins\s ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:137) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:349) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:317) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:173) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) {noformat}

    Jenkins JIRA | 2 years ago | Anders Hammar
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 4: unexpected char: '\' @ line 4, column 74. n.repo.local=.repository -s D:\Jenkins\s ^ 1 error
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    {code:none} {/* supposed to be a block but this is wrong */} {code} yields {code:none} ERROR: failed to start build org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 2: Ambiguous expression could be either a parameterless closure expression or an isolated open code block; solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 2, column 1. { ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:346) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:314) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) {code} but then the build is still shown as running, and the stop button does not work. Need to forcibly delete it.

    Jenkins JIRA | 2 years ago | Jesse Glick
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 2: Ambiguous expression could be either a parameterless closure expression or an isolated open code block; solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 2, column 1. { ^ 1 error
  6. 0

    I have a workflow project, for which I typed an error inte the Groovy script. When executing the build it then reports an error in the console and then hangs (doesn't terminate). This is the output in the build console: {noformat} Started by user Anders Hammar ERROR: failed to start build org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 4: unexpected char: '\' @ line 4, column 74. n.repo.local=.repository -s D:\Jenkins\s ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:137) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:349) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:317) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:173) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43) {noformat}

    Jenkins JIRA | 2 years ago | Anders Hammar
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 4: unexpected char: '\' @ line 4, column 74. n.repo.local=.repository -s D:\Jenkins\s ^ 1 error

  1. serious2monkeys 8 times, last 2 weeks ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.codehaus.groovy.control.MultipleCompilationErrorsException

    startup failed: file:/.../workflow-libs/src/chef/Cookbook.groovy: 5: Invalid duplicate class definition of class chef.Cookbook : The source file:/.../workflow-libs/src/chef/Cookbook.groovy contains at least two definitions of the class chef.Cookbook. One of the classes is an explicit generated class using the class statement, the other is a class generated from the script body based on the file name. Solutions are to change the file name or to change the class name. @ line 5, column 1. class Cookbook { ^ 1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors()
  2. Groovy
    GroovyShell.parse
    1. org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
    2. org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:861)
    3. org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550)
    4. org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)
    5. org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)
    6. groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
    7. groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
    8. groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
    9. groovy.lang.GroovyShell.parse(GroovyShell.java:743)
    9 frames
  3. org.jenkinsci.plugins
    WorkflowRun.run
    1. org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:100)
    2. org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:346)
    3. org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:314)
    4. org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:176)
    4 frames
  4. Hudson
    OneOffExecutor.run
    1. hudson.model.ResourceController.execute(ResourceController.java:89)
    2. hudson.model.Executor.run(Executor.java:240)
    3. hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
    3 frames