org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: beans.groovy: 1: you tried to assign a value to the class 'beans'. Do you have a script with this name? @ line 1, column 1. beans = { ^ 1 error

Spring JIRA | Grzegorz Ćwiak | 2 years ago
  1. 0

    GenericGroovyApplicationContext propagates BeanDefinitionParsingException only when context file is named 'beans.groovy' Given: incorrect groovy bean config: beans = { foo String, 'hello' } Here '=' sign in this place is a mistake. When instantiating the context: GenericGroovyApplicationContext context = new GenericGroovyApplicationContext("classpath:beans.groovy"); It behaves differently depending on file name of the corrupted groovy config: - when it is named in any other way than 'beans.groovy', e.g. 'myServiceContext.groovy', than no exception is thrown, the context starts up but without any beans created, context.getBeanDefinitionCount() returns 0. - when it is named 'beans.groovy' the following error is reported: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Error evaluating Groovy script: startup failed: beans.groovy: 1: you tried to assign a value to the class 'beans'. Do you have a script with this name? @ line 1, column 1. beans = { ^ 1 error Offending resource: class path resource [beans.groovy]; nested exception is org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: beans.groovy: 1: you tried to assign a value to the class 'beans'. Do you have a script with this name? @ line 1, column 1. beans = { ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:927) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:575) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:524) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613) at groovy.lang.GroovyShell.parse(GroovyShell.java:625) at groovy.lang.GroovyShell.parse(GroovyShell.java:605) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:586) at org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:229) at org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:196) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:251) at org.springframework.context.support.GenericGroovyApplicationContext.load(GenericGroovyApplicationContext.java:195)

    Spring JIRA | 2 years ago | Grzegorz Ćwiak
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: beans.groovy: 1: you tried to assign a value to the class 'beans'. Do you have a script with this name? @ line 1, column 1. beans = { ^ 1 error
  2. 0

    There is an outstanding issue with Grails on certain environments (see: http://jira.codehaus.org/browse/GRAILS-4295) where parameters are not parsed correctly. The work around is to surround the parameter in double quotes so for example: grails maven-deploy "--repository=snapshot" The problem lies in that you can't escape the inner quotes in the Target field when building a Hudson project so: "grails maven-deploy \"--repository=snapshot\"" Throws the following error when the project is next built: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: expecting EOF, found 'repository' @ line 1, column 12. 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:143) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:353) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:92) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:59) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:249) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:160) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:801) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:466) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:590) at groovy.lang.GroovyShell.parse(GroovyShell.java:602) at groovy.lang.GroovyShell.parse(GroovyShell.java:582) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:560) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:536) at com.g2one.hudson.grails.GrailsBuilder.evalTarget(GrailsBuilder.java:212) at com.g2one.hudson.grails.GrailsBuilder.perform(GrailsBuilder.java:168) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:600) at hudson.model.Build$RunnerImpl.build(Build.java:174) at hudson.model.Build$RunnerImpl.doRun(Build.java:138) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1244) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122)

    Jenkins JIRA | 6 years ago | scheeser
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: expecting EOF, found 'repository' @ line 1, column 12. 1 error
  3. 0

    There is an outstanding issue with Grails on certain environments (see: http://jira.codehaus.org/browse/GRAILS-4295) where parameters are not parsed correctly. The work around is to surround the parameter in double quotes so for example: grails maven-deploy "--repository=snapshot" The problem lies in that you can't escape the inner quotes in the Target field when building a Hudson project so: "grails maven-deploy \"--repository=snapshot\"" Throws the following error when the project is next built: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: expecting EOF, found 'repository' @ line 1, column 12. 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:143) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:353) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:92) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:59) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:249) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:160) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:801) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:466) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:590) at groovy.lang.GroovyShell.parse(GroovyShell.java:602) at groovy.lang.GroovyShell.parse(GroovyShell.java:582) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:560) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:536) at com.g2one.hudson.grails.GrailsBuilder.evalTarget(GrailsBuilder.java:212) at com.g2one.hudson.grails.GrailsBuilder.perform(GrailsBuilder.java:168) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:600) at hudson.model.Build$RunnerImpl.build(Build.java:174) at hudson.model.Build$RunnerImpl.doRun(Build.java:138) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1244) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122)

    Jenkins JIRA | 6 years ago | scheeser
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: expecting EOF, found 'repository' @ line 1, column 12. 1 error
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When we were using "Dynamic Choice Parameter (Scriptler)", we found something is not right.We wanted to run a script, which would import classes of svnkit, to get a list of pathes in svn. The script was as follow: {code:java} import java.util.* import org.tmatesoft.svn.core.ISVNDirEntryHandler import org.tmatesoft.svn.core.SVNDirEntry import org.tmatesoft.svn.core.SVNNodeKind import org.tmatesoft.svn.core.SVNException class SVNDirEntryHandlerImpl implements ISVNDirEntryHandler { List<SVNDirEntry> dirs = new ArrayList<SVNDirEntry>() void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirs.add(dirEntry) } } def h = new SVNDirEntryHandlerImpl() // get svn client, and list dir from svn // we do not show it, because it is not important def result = [] h.dirs.each() { def dirName = it.name if (null != dirName && dirName.length() > 0 && SVNNodeKind.DIR == it.kind) { result.add(dirName) } result.add(dirName) } return result {code} The script was run well in Scriptler, but we got an empty list in job build parameter, without any errors.We read the log of tomcat, and we found "unable to resolve class" error. Log was as follow: {code:none} 2013-7-29 10:37:34 com.seitenbau.jenkins.plugins.dynamicparameter.BaseParameterDefinition executeScript 严重: Error during executing script for parameter 'test' org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 4: unable to resolve class org.tmatesoft.svn.core.SVNNodeKind @ line 4, column 1. import org.tmatesoft.svn.core.SVNNodeKind ^ Script1.groovy: 5: unable to resolve class org.tmatesoft.svn.core.SVNException @ line 5, column 1. import org.tmatesoft.svn.core.SVNException ^ Script1.groovy: 2: unable to resolve class org.tmatesoft.svn.core.ISVNDirEntryHandler @ line 2, column 1. import org.tmatesoft.svn.core.ISVNDirEntryHandler ^ Script1.groovy: 3: unable to resolve class org.tmatesoft.svn.core.SVNDirEntry @ line 3, column 1. import org.tmatesoft.svn.core.SVNDirEntry ^ 4 errors at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:858) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:578) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589) at com.seitenbau.jenkins.plugins.dynamicparameter.util.JenkinsUtils.execute(JenkinsUtils.java:88) at com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerParameterDefinition$ParameterizedScriptCall.call(ScriptlerParameterDefinition.java:170) at com.seitenbau.jenkins.plugins.dynamicparameter.BaseParameterDefinition.executeScript(BaseParameterDefinition.java:221) at com.seitenbau.jenkins.plugins.dynamicparameter.BaseParameterDefinition.getScriptResultAsList(BaseParameterDefinition.java:117) at com.seitenbau.jenkins.plugins.dynamicparameter.scriptler.ScriptlerChoiceParameterDefinition.getChoices(ScriptlerChoiceParameterDefinition.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185) at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61) at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:94) at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:89) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81) at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53) at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:55) at hudson.model.ParametersDefinitionProperty._doBuild(ParametersDefinitionProperty.java:112) at hudson.model.AbstractProject.doBuild(AbstractProject.java:1651) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:574) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:659) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:488) at org.kohsuke.stapler.Stapler.service(Stapler.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:63) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) {code} After reading the code of "Jenkins Dynamic Parameter Plug-in"(TAG 0.2.0), "Scriptler Plugin" and Groovy, we found the reason of this error. The code of function *execute(String script, Map<String, String> parameters)* in class *com.seitenbau.jenkins.plugins.dynamicparameter.util.JenkinsUtils* is as follow: {code:java|title=JenkinsUtils.java} public static Object execute(String script, Map<String, String> parameters) { CompilerConfiguration config = new CompilerConfiguration(); GroovyShell groovyShell = new GroovyShell(config); for (Entry<String, String> parameter : parameters.entrySet()) { groovyShell.setVariable(parameter.getKey(), parameter.getValue()); } Object evaluate = groovyShell.evaluate(script); return evaluate; } {code} Here, groovyShell use the constructor *GroovyShell(CompilerConfiguration config)*, so Groovy use the class loader of GroovyShell as the parent class loader of Groovy. The class GroovyShell is loaded by Jenkins(You can find the jars of goorvy in webapps\jenkins\WEB-INF\lib). The class loader of GroovyShell is same to Jenkins. The classes of svnkit are loaded by subversion plugin(You can find the jars of svnkit in the path of subversion plugin). The class loader of svnkit classes is same to subversion plugin. According to document of Jenkins, the class loader of plugin extends the class loader of Jenkins, so the class loader of Groovy can not find the classes of svnkit. We sugget that modify the function *execute(String script, Map<String, String> parameters)* to follow: {code:java|title=JenkinsUtils.java} public static Object execute(String script, Map<String, String> parameters) { //CompilerConfiguration config = new CompilerConfiguration(); GroovyShell groovyShell = new GroovyShell(Thread.currentThread().getContextClassLoader()); for (Entry<String, String> parameter : parameters.entrySet()) { groovyShell.setVariable(parameter.getKey(), parameter.getValue()); } Object evaluate = groovyShell.evaluate(script); return evaluate; } {code} Then Groovy will use the context class loader of current thread as the parent class loader, and Groovy can find the classes of svnkit. We test this code in Jenkins, the script run well, and we get the list which we want.

    Jenkins JIRA | 3 years ago | BingXi Li
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 4: unable to resolve class org.tmatesoft.svn.core.SVNNodeKind @ line 4, column 1. import org.tmatesoft.svn.core.SVNNodeKind ^ Script1.groovy: 5: unable to resolve class org.tmatesoft.svn.core.SVNException @ line 5, column 1. import org.tmatesoft.svn.core.SVNException ^ Script1.groovy: 2: unable to resolve class org.tmatesoft.svn.core.ISVNDirEntryHandler @ line 2, column 1. import org.tmatesoft.svn.core.ISVNDirEntryHandler ^ Script1.groovy: 3: unable to resolve class org.tmatesoft.svn.core.SVNDirEntry @ line 3, column 1. import org.tmatesoft.svn.core.SVNDirEntry ^ 4 errors
  6. 0

    [JENKINS-18972] About class loader of "Dynamic Choice Parameter (Scriptler)" (Version 0.2.0) - Jenkins JIRA

    jenkins-ci.org | 4 months ago
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 4: unable to resolve class org.tmatesoft.svn.core.SVNNodeKind @ line 4, column 1. import org.tmatesoft.svn.core.SVNNodeKind ^ Script1.groovy: 5: unable to resolve class org.tmatesoft.svn.core.SVNException @ line 5, column 1. import org.tmatesoft.svn.core.SVNException ^ Script1.groovy: 2: unable to resolve class org.tmatesoft.svn.core.ISVNDirEntryHandler @ line 2, column 1. import org.tmatesoft.svn.core.ISVNDirEntryHandler ^ Script1.groovy: 3: unable to resolve class org.tmatesoft.svn.core.SVNDirEntry @ line 3, column 1. import org.tmatesoft.svn.core.SVNDirEntry ^ 4 errors

    4 unregistered visitors
    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: beans.groovy: 1: you tried to assign a value to the class 'beans'. Do you have a script with this name? @ line 1, column 1. beans = { ^ 1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors()
    2. Groovy
      GroovyShell.evaluate
      1. org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
      2. org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:927)
      3. org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:575)
      4. org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:524)
      5. groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
      6. groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
      7. groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)
      8. groovy.lang.GroovyShell.parse(GroovyShell.java:625)
      9. groovy.lang.GroovyShell.parse(GroovyShell.java:605)
      10. groovy.lang.GroovyShell.evaluate(GroovyShell.java:586)
      10 frames
    3. org.springframework.beans
      GroovyBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:229)
      2. org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:196)
      2 frames
    4. Spring Beans
      AbstractBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
      2. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
      3. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
      4. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:251)
      4 frames
    5. Spring Context
      GenericGroovyApplicationContext.load
      1. org.springframework.context.support.GenericGroovyApplicationContext.load(GenericGroovyApplicationContext.java:195)
      1 frame