getting Run crashed when i run the Karate gatling with Gradle - gradle

package mock
import com.intuit.karate.gatling.PreDef._
import io.gatling.core.Predef._
import scala.concurrent.duration._
class CatsKarateSimulation extends Simulation {
MockUtils.startServer()
val feeder = Iterator.continually(Map("catName" -> MockUtils.getNextCatName))
val protocol = karateProtocol(
"/cats/{id}" -> Nil,
"/cats" -> pauseFor("get" -> 15, "post" -> 25)
)
protocol.nameResolver = (req, ctx) => req.getHeader("karate-name")
val create = scenario("create").feed(feeder).exec(karateFeature("classpath:mock/cats-create.feature"))
val delete = scenario("delete").group("delete cats") {
exec(karateFeature("classpath:mock/cats-delete.feature#name=delete"))
}
val custom = scenario("custom").exec(karateFeature("classpath:mock/custom-rpc.feature"))
setUp(
create.inject(rampUsers(10) during (5 seconds)).protocols(protocol),
delete.inject(rampUsers(5) during (5 seconds)).protocols(protocol),
custom.inject(rampUsers(10) during (5 seconds)).protocols(protocol)
)
}
Can anyone help why I am getting this error:
Currently my project has karate api scripts and there are few java helper classes in it, i need to implement the Gatling with gradle.
Java: 11
Gradle: Gradle 7.5.1
Windows 10
Eclipse IDE
build.gradle
enter image description here
Simulation
enter image description here
Folder structure
enter image description here
Error
15:50:51.523 [main] ERROR io.gatling.app.Gatling$ - Run crashed java.lang.IllegalArgumentException: User defined Simulation class mock.CatsKarateSimulation could not be loaded at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:87) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$4(Selection.scala:91) at scala.Option.orElse(Option.scala:477) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$3(Selection.scala:91) at scala.Option.flatMap(Option.scala:283) at io.gatling.app.Selection$Selector.singleSimulationFromConfig(Selection.scala:90) at io.gatling.app.Selection$Selector.$anonfun$selection$1(Selection.scala:52) at scala.Option.getOrElse(Option.scala:201) at io.gatling.app.Selection$Selector.selection(Selection.scala:44) at io.gatling.app.Selection$.apply(Selection.scala:36) at io.gatling.app.Runner.run0(Runner.scala:61) at io.gatling.app.Runner.run(Runner.scala:49) at io.gatling.app.Gatling$.start(Gatling.scala:87) at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49) at io.gatling.app.Gatling$.main(Gatling.scala:38) at io.gatling.app.Gatling.main(Gatling.scala) Caused by: java.lang.ClassNotFoundException: mock.CatsKarateSimulation at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$2(Selection.scala:76) at scala.util.Try$.apply(Try.scala:210) at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:76) ... 15 common frames omitted Exception in thread "main" java.lang.IllegalArgumentException: User defined Simulation class mock.CatsKarateSimulation could not be loaded at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:87) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$4(Selection.scala:91) at scala.Option.orElse(Option.scala:477) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$3(Selection.scala:91) at scala.Option.flatMap(Option.scala:283) at io.gatling.app.Selection$Selector.singleSimulationFromConfig(Selection.scala:90) at io.gatling.app.Selection$Selector.$anonfun$selection$1(Selection.scala:52) at scala.Option.getOrElse(Option.scala:201) at io.gatling.app.Selection$Selector.selection(Selection.scala:44) at io.gatling.app.Selection$.apply(Selection.scala:36) at io.gatling.app.Runner.run0(Runner.scala:61) at io.gatling.app.Runner.run(Runner.scala:49) at io.gatling.app.Gatling$.start(Gatling.scala:87) at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49) at io.gatling.app.Gatling$.main(Gatling.scala:38) at io.gatling.app.Gatling.main(Gatling.scala) Caused by: java.lang.ClassNotFoundException: mock.CatsKarateSimulation at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at io.gatling.app.Selection$Selector.$anonfun$singleSimulationFromConfig$2(Selection.scala:76) at scala.util.Try$.apply(Try.scala:210) at io.gatling.app.Selection$Selector.findUserDefinedSimulationInClassloader$1(Selection.scala:76)

Related

Debezium content based router setup unable to find DebeziumException

I'm trying to setup a Debezium source connector in docker which uses ContentBasedRouting and I'm following the official doc.
I have all the following dependencies in /kafka/connect/debezium-connector-mysql:
antlr4-runtime-4.7.2.jar groovy-3.0.9.jar
debezium-connector-mysql-1.0.3.Final.jar groovy-json-3.0.9.jar
debezium-core-1.0.3.Final.jar groovy-jsr223-3.0.9.jar
debezium-ddl-parser-1.0.3.Final.jar mysql-binlog-connector-java-0.19.1.jar
debezium-scripting-1.7.2.Final.jar mysql-connector-java-8.0.16.jar
At the moment I'm trying to add the connector with the following transforms:
"transforms": "route",
"transforms.route.type": "io.debezium.transforms.ContentBasedRouter",
"transforms.route.language": "jsr223.groovy",
"transforms.route.topic.expression": "value.after.name == 'x' ? 'topic1' : null",
"transforms.route.null.handling.mode": "drop"
I get http status 500 and the log:
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: io/debezium/DebeziumException
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:408)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:365)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:318)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:173)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:494)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: io/debezium/DebeziumException
at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:254)
at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:236)
at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:436)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:679)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:392)
... 28 more
Caused by: java.lang.NoClassDefFoundError: io/debezium/DebeziumException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:719)
at org.apache.kafka.connect.runtime.ConnectorConfig.enrich(ConnectorConfig.java:308)
at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:302)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder$6.call(DistributedHerder.java:745)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder$6.call(DistributedHerder.java:742)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:342)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:282)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
Caused by: java.lang.ClassNotFoundException: io.debezium.DebeziumException
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:104)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 14 more
Tried adding a connector without the transform (everything else unchanged) and it worked.
What am I doing wrong?
Ok so I solved it by starting from clean environment because I've probably played with a mix of too many versions. Made sure I'm using Debezium 1.8 for everything and maybe the weirdest thing is that I had to put all the Debezium jars on the connect container in /kafka/libs because it didn't work in /kafka/connect/debezium-connector-mysql for some reason...

Grails with micronaut-elasticsearch plugin

I am migrating a project form
grails 3.0.3 and elasticsearch 1.7.3 to
grails 4.0.4 and elasticsearch 7.13.
Unfortunately, the elasticsearch-groovy-plugin is not actively maintained and it seems, that the best option is to switch to micronaut-elasticsearch.
To test this option, I've created a new grails 4.0.4 application and added
compile 'io.micronaut.elasticsearch:micronaut-elasticsearch:2.3.0'
to the gradle.build file. Unfortunately I get the following error:
| Error Failed to compile CreateFunctionalTest.groovy: Error loading service [io.micronaut.validation.validator.DefaultAnnotatedElementValidator]: Error loading BeanIntrospection for type [class io.micronaut.validation.validator.constraints.DefaultConstraintValidators]: 'void io.micronaut.core.beans.AbstractBeanIntrospection.<init>(java.lang.Class, io.micronaut.core.annotation.AnnotationMetadata, int, int)' (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.util.ServiceConfigurationError: Error loading service [io.micronaut.validation.validator.DefaultAnnotatedElementValidator]: Error loading BeanIntrospection for type [class io.micronaut.validation.validator.constraints.DefaultConstraintValidators]: 'void io.micronaut.core.beans.AbstractBeanIntrospection.<init>(java.lang.Class, io.micronaut.core.annotation.AnnotationMetadata, int, int)'
at io.micronaut.core.io.service.DefaultServiceDefinition.lambda$load$0(DefaultServiceDefinition.java:71)
at io.micronaut.core.io.service.DefaultServiceDefinition.load(DefaultServiceDefinition.java:67)
at io.micronaut.ast.groovy.annotation.GroovyAnnotationMetadataBuilder.<init>(GroovyAnnotationMetadataBuilder.groovy:90)
at io.micronaut.ast.groovy.utils.AstAnnotationUtils$_getAnnotationMetadata_closure1.doCall(AstAnnotationUtils.groovy:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.sun.proxy.$Proxy20.apply(Unknown Source)
at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.lambda$compute$0(ConcurrentLinkedHashMap.java:721)
at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.compute(ConcurrentLinkedHashMap.java:733)
at io.micronaut.core.util.clhm.ConcurrentLinkedHashMap.computeIfAbsent(ConcurrentLinkedHashMap.java:710)
at io.micronaut.ast.groovy.utils.AstAnnotationUtils.getAnnotationMetadata(AstAnnotationUtils.groovy:53)
at io.micronaut.ast.groovy.TypeElementVisitorTransform.visit(TypeElementVisitorTransform.groovy:83)
at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy:50)
at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy)
at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:44)
at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:439)
at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
at org.grails.cli.profile.AbstractProfile.getCompleters(AbstractProfile.groovy:369)
at org.grails.cli.GrailsCli.setupCompleters(GrailsCli.groovy:420)
at org.grails.cli.GrailsCli.handleInteractiveMode(GrailsCli.groovy:402)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:273)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
Caused by: io.micronaut.core.beans.exceptions.IntrospectionException: Error loading BeanIntrospection for type [class io.micronaut.validation.validator.constraints.DefaultConstraintValidators]: 'void io.micronaut.core.beans.AbstractBeanIntrospection.<init>(java.lang.Class, io.micronaut.core.annotation.AnnotationMetadata, int, int)'
at io.micronaut.core.beans.DefaultBeanIntrospector.findIntrospection(DefaultBeanIntrospector.java:80)
at io.micronaut.core.beans.BeanWrapper.findWrapper(BeanWrapper.java:240)
at io.micronaut.validation.validator.constraints.DefaultConstraintValidators.<init>(DefaultConstraintValidators.java:335)
at io.micronaut.validation.validator.constraints.DefaultConstraintValidators.<init>(DefaultConstraintValidators.java:324)
at io.micronaut.validation.validator.DefaultAnnotatedElementValidator$LocalConstraintValidators.<init>(DefaultAnnotatedElementValidator.java:56)
at io.micronaut.validation.validator.DefaultAnnotatedElementValidator$LocalConstraintValidators.<init>(DefaultAnnotatedElementValidator.java:56)
at io.micronaut.validation.validator.DefaultAnnotatedElementValidator.<init>(DefaultAnnotatedElementValidator.java:49)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at io.micronaut.core.io.service.DefaultServiceDefinition.lambda$load$0(DefaultServiceDefinition.java:69)
... 24 more
Caused by: java.lang.NoSuchMethodError: 'void io.micronaut.core.beans.AbstractBeanIntrospection.<init>(java.lang.Class, io.micronaut.core.annotation.AnnotationMetadata, int, int)'
at io.micronaut.validation.validator.constraints.$DefaultConstraintValidators$Introspection.<init>(Unknown Source)
at io.micronaut.validation.validator.constraints.$DefaultConstraintValidators$IntrospectionRef.load(Unknown Source)
at io.micronaut.core.beans.DefaultBeanIntrospector.lambda$findIntrospection$0(DefaultBeanIntrospector.java:71)
at io.micronaut.core.beans.DefaultBeanIntrospector.findIntrospection(DefaultBeanIntrospector.java:67)
... 34 more
| Error Failed to compile CreateFunctionalTest.groovy: Error loading service [io.micronaut.validation.validator.DefaultAnnotatedElementValidator]: Error loading BeanIntrospection for type [class io.micronaut.validation.validator.constraints.DefaultConstraintValidators]: 'void io.micronaut.core.beans.AbstractBeanIntrospection.<init>(java.lang.Class, io.micronaut.core.annotation.AnnotationMetadata, int, int)'
| Error Error occurred running Grails CLI: null (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException
at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy:85)
at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy)
at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:46)
at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:439)
at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
at org.grails.cli.profile.AbstractProfile.getCompleters(AbstractProfile.groovy:369)
at org.grails.cli.GrailsCli.setupCompleters(GrailsCli.groovy:420)
at org.grails.cli.GrailsCli.handleInteractiveMode(GrailsCli.groovy:402)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:273)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Error occurred running Grails CLI: null
Do I miss something here?
micronaut-elasticsearch is not a part of grails-bom. So you have to specify a version of the dependency.
compile 'io.micronaut.elasticsearch:micronaut-elasticsearch:2.3.0'
https://mvnrepository.com/artifact/io.micronaut.elasticsearch/micronaut-elasticsearch

Jenkins MultiBranchPipeline Failing with ModelInterpreter.groovy: 43: unable to resolve class javax.annotation.Nonnull

I am trying to setup a multi branch pipeline between Github and Jenkins. I am working on a spring boot project and I have setup my local jdk and maven within Jenkins.
I am running the pipeline using jenkinsfile, the pipeline code is as below:
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
Jenkins is able to scan my repo successfully, however on running the pipeline I am getting below error which I am clueless about. Could you please help me in breaking this barrier I am stuck at this.
16:35:38 Connecting to https://api.github.com using shred22/****** (Git Hub Credentials)
Obtained Jenkinsfile from ab4673fa1cc076e4ce773fbc2be9c3756aac0bc8
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] End of Pipeline
GitHub has been notified of this commit’s build result
hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 43: unable to resolve class javax.annotation.Nonnull
# line 43, column 1.
import javax.annotation.Nonnull
^
jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 42: unable to resolve class javax.annotation.CheckForNull
# line 42, column 1.
import javax.annotation.CheckForNull
^
jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 455: unable to resolve class javax.annotation.CheckForNull , unable to find class for annotation
# line 455, column 30.
def withCredentialsBlock(#CheckForNull Environment environment, Closure body) {
^
jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 493: unable to resolve class javax.annotation.Nonnull , unable to find class for annotation
# line 493, column 13.
#Nonnull Map<String, CredentialWrapper> credentials) {
^
4 errors
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:958)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:554)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:254)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:250)
at groovy.lang.GroovyClassLoader.recompile(GroovyClassLoader.java:766)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:718)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:575)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell$TimingLoader.loadClass(CpsGroovyShell.java:170)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:575)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775)
at org.jenkinsci.plugins.pipeline.modeldefinition.ModelStepLoader.getValue(ModelStepLoader.java:60)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:142)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
at WorkflowScript.run(WorkflowScript:1)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Finished: FAILURE
Please check the upstream issue.
I worked around by downgrading Pipeline: Groovy package to v2.80 from v2.81. (However, the PR is ready in upstream so I believe v2.82 will be released soon.)
https://issues.jenkins-ci.org/browse/JENKINS-62988
https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/397
I have worked around the problem by removing the two imports and the annotations from the coded in ModelInterpreter.groovy in the jar file and replacing the jar file. That makes it work, since the annotations are optional it will probably not cause problems.

Inline Script error

I am trying to run the Update api using Inline Scripting ,my code is
client.prepareUpdate("result",typeName, "1")
.setScript(new Script("ctx._source.gender=doc['"+AggregateValue_First+"'].value*doc['"+AggregateValue_Second+"'].value",ScriptType.INLINE, null, null))
.get();
When I am executing it , i am getting
java.lang.IllegalArgumentException: failed to execute script
my log looks like
Caused by: ScriptException[failed to run inline script
[ctx._source.gender =
doc['AVG_PRICE_PER_UNIT'].value*doc['NUMBER_OF_UNITS'].value] using
lang [groovy]]; nested:
NotSerializableExceptionWrapper[missing_property_exception: No such
property: doc for class: af9b76c11012333a0eeba6af6df35125322f36b8];
at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:320)
at
org.elasticsearch.action.update.UpdateHelper.executeScript(UpdateHelper.java:252)... 14 more
Caused by: NotSerializableExceptionWrapper[missing_property_exception:
No such property: doc for class:
af9b76c11012333a0eeba6af6df35125322f36b8] at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at
org.codehaus.groovy.vmplugin.v7.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:177)
at
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:228)
at
af9b76c11012333a0eeba6af6df35125322f36b8.run(af9b76c11012333a0eeba6af6df35125322f36b8:1)
at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript$1.run(GroovyScriptEngineService.java:313)
at java.security.AccessController.doPrivileged(Native Method) at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:310)
... 15 more
Can someone help me with this?
i tried
client.prepareUpdate("result",typeName,"1").setScript(newScript("ctx._source.gender.value =
ctx._source['"+AggregateValue_First+"'].value *
ctx._source['"+AggregateValue_Second+"'].value", ScriptType.INLINE,
null, null)) .get();
now the error is something like
log4j:WARN No appenders could be found for logger
(org.elasticsearch.node). log4j:WARN Please initialize the log4j
system properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
java.lang.IllegalArgumentException: failed to execute script at
org.elasticsearch.action.update.UpdateHelper.executeScript(UpdateHelper.java:257)
at
org.elasticsearch.action.update.UpdateHelper.prepare(UpdateHelper.java:197)
at
org.elasticsearch.action.update.UpdateHelper.prepare(UpdateHelper.java:80)
at
org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:174)
at
org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:168)
at
org.elasticsearch.action.update.TransportUpdateAction.shardOperation(TransportUpdateAction.java:66)
at
org.elasticsearch.action.support.single.instance.TransportInstanceSingleOperationAction$ShardTransportHandler.messageReceived(TransportInstanceSingleOperationAction.java:244)
at
org.elasticsearch.action.support.single.instance.TransportInstanceSingleOperationAction$ShardTransportHandler.messageReceived(TransportInstanceSingleOperationAction.java:240)
at
org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
at
org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75)
at
org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(MessageChannelHandler.java:300)
at
org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) Caused by:
ScriptException[failed to run inline script [ctx._source.gender.value
= ctx._source['AVG_PRICE_PER_UNIT'].value * ctx._source['5'].value] using lang [groovy]]; nested: AssertionError[BUG! UNCAUGHT EXCEPTION:
member is private: java.lang.Integer.value/int/getField, from
org.codehaus.groovy.vmplugin.v7.IndyInterface]; nested:
NotSerializableExceptionWrapper[illegal_access_exception: member is
private: java.lang.Integer.value/int/getField, from
org.codehaus.groovy.vmplugin.v7.IndyInterface]; at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:320)
at
org.elasticsearch.action.update.UpdateHelper.executeScript(UpdateHelper.java:252)
... 14 more Caused by: java.lang.AssertionError: BUG! UNCAUGHT
EXCEPTION: member is private: java.lang.Integer.value/int/getField,
from org.codehaus.groovy.vmplugin.v7.IndyInterface at
org.codehaus.groovy.vmplugin.v7.Selector$PropertySelector.chooseMeta(Selector.java:311)
at
org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.setCallSiteTarget(Selector.java:954)
at
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:224)
at
a45669ea4b74cc2cb4371072fd14ab69cb5dd5f6.run(a45669ea4b74cc2cb4371072fd14ab69cb5dd5f6:1)
at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript$1.run(GroovyScriptEngineService.java:313)
at java.security.AccessController.doPrivileged(Native Method) at
org.elasticsearch.script.groovy.GroovyScriptEngineService$GroovyScript.run(GroovyScriptEngineService.java:310)
... 15 more Caused by:
NotSerializableExceptionWrapper[illegal_access_exception: member is
private: java.lang.Integer.value/int/getField, from
org.codehaus.groovy.vmplugin.v7.IndyInterface] at
java.lang.invoke.MemberName.makeAccessException(Unknown Source) at
java.lang.invoke.MethodHandles$Lookup.checkAccess(Unknown Source) at
java.lang.invoke.MethodHandles$Lookup.checkField(Unknown Source) at
java.lang.invoke.MethodHandles$Lookup.getDirectFieldCommon(Unknown
Source) at
java.lang.invoke.MethodHandles$Lookup.getDirectFieldNoSecurityManager(Unknown
Source) at
java.lang.invoke.MethodHandles$Lookup.unreflectField(Unknown Source)
at java.lang.invoke.MethodHandles$Lookup.unreflectGetter(Unknown
Source) at
org.codehaus.groovy.vmplugin.v7.Selector$PropertySelector.chooseMeta(Selector.java:302)
... 21 more
Try this (i.e. use ctx._source instead of doc):
client.prepareUpdate("result",typeName, "1")
.setScript(new Script("ctx._source.gender = ctx._source['"+AggregateValue_First+"'] * ctx._source['"+AggregateValue_Second+"']", ScriptType.INLINE, null, null))
.get();

Gradle NoClassDefFoundError

So I am trying build a simple gradle app and when I run it, I getting
geb.ConfigurationLoader$UnableToLoadException: Unable to load configuration # 'file:/Users/john/Development/groovy/gradlegebautomation/build/resources/test/GebConfig.groovy' (with environment: null)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:297)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:281)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:161)
at geb.ConfigurationLoader.doGetConf(ConfigurationLoader.groovy:139)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:95)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:114)
at geb.spock.GebSpec.createConf(GebSpec.groovy:29)
at geb.spock.GebSpec.createBrowser(GebSpec.groovy:33)
at geb.spock.GebSpec.getBrowser(GebSpec.groovy:38)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at geb.spock.GebReportingSpec.setupSpec(GebReportingSpec.groovy:30)
Caused by: java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport
at java.lang.Class.privateGetDeclaredMethods(Class.java:2436)
at java.lang.Class.getDeclaredMethods(Class.java:1793)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at groovy.grape.GrapeIvy.<init>(GrapeIvy.groovy:75)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at groovy.grape.Grape.getInstance(Grape.java:101)
at groovy.grape.Grape.grab(Grape.java:136)
at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:291)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:319)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:903)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:566)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:542)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:519)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:202)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:212)
at groovy.util.ConfigSlurper.parse(ConfigSlurper.groovy:146)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:295)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.ivy.core.report.ResolveReport
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 32 more
So I created the folder structure src/test/groovy and src/main/groovy. I also created inside of test/groovy, another folder called store. So I can get this to work if I put the GebConfig.groovy in the src/test/groovy and src/test/groovy/store. Anything else I get the error above. Here is my build.gradle
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '2.0.5'
groovy group: 'org.apache.ivy', name:'ivy', version:'2.2.0'
compile 'org.codehaus.groovy:groovy-all:2.0.5'
testCompile 'junit:junit:4.11'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'org.gebish:geb-spock:0.9.0-RC-1'
testCompile 'org.seleniumhq.selenium:selenium-firefox-driver:2.31.0'
}
Here is my test
package groovy.store
import geb.spock.GebReportingSpec
class SimpleSpec extends GebReportingSpec {
def "Doing a simple Guest checkout"() {
given: "A test"
def hello
when: ""
hello = "Hello"
then:
assert hello == "Hello"
}
}
Thoughts?
UPDATE v1:
Ok, it looks like I needed to add a new dependency in my build.gradle. I added the ivy dep and now I am getting this error:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileTestGroovy'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:72)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:49)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:275)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:52)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:38)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:30)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:84)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:121)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:39)
at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:52)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Here is my GebConfig
import org.openqa.selenium.firefox.FirefoxDriver
//reportsDir = "target/geb-reports"
// default is to use firefox
driver = {
def driver = new FirefoxDriver()
driver.manage().window().maximize()
return driver
}
environments {
'firefox' {
driver = {
def driver = new FirefoxDriver()
driver.manage().window().maximize()
return driver
}
}
}
UPDATE V2:
Oh, I see if I go a little higher in the stack I see the following:
startup failed:
Could not instantiate global transform class org.spockframework.compiler.SpockTransform specified at jar:file:/Users/john/.gradle/caches/artifacts-23/filestore/org.spockframework/spock-core/0.7-groovy-2.0/jar/4de0b428de0c14b6eb6375d8174f71848cbfc1d7/spock-core-0.7-groovy-2.0.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception org.spockframework.util.IncompatibleGroovyVersionException: The Spock compiler plugin cannot execute because Spock 0.7.0-groovy-2.0 is not compatible with Groovy 1.8.6. For more information, see http://versioninfo.spockframework.org
Spock location: file:/Users/john/.gradle/caches/artifacts-23/filestore/org.spockframework/spock-core/0.7-groovy-2.0/jar/4de0b428de0c14b6eb6375d8174f71848cbfc1d7/spock-core-0.7-groovy-2.0.jar
Groovy location: file:/Users/john/bin/gradle-1.5/lib/groovy-all-1.8.6.jar
UPDATE v3:
So I added regular groovy into my dependencies, see above. I am not passing the compile stage and failing at the test stage. Here is the message that is coming up in the report
geb.ConfigurationLoader$UnableToLoadException: Unable to load configuration from class 'class GebConfig' (with environment: null)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:297)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:290)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:226)
at geb.ConfigurationLoader.doGetConfFromClass(ConfigurationLoader.groovy:200)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:95)
at geb.ConfigurationLoader.getConf(ConfigurationLoader.groovy:114)
at geb.spock.GebSpec.createConf(GebSpec.groovy:29)
at geb.spock.GebSpec.createBrowser(GebSpec.groovy:33)
at geb.spock.GebSpec.getBrowser(GebSpec.groovy:38)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at geb.spock.GebReportingSpec.setupSpec(GebReportingSpec.groovy:30)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName(Class.java:249)
at groovy.util.ConfigSlurper.parse(ConfigSlurper.groovy:127)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:295)
... 10 more
Caused by: java.lang.RuntimeException: No suitable ClassLoader found for grab
at groovy.grape.GrapeIvy.chooseClassLoader(GrapeIvy.groovy:181)
at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:247)
at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:236)
at groovy.grape.Grape.grab(Grape.java:129)
... 13 more
what bothered me first on this one was that there was no choice of which environment to be used from the config file; your first list said:
favorite
So I am trying build a simple gradle app and when I run it, I getting
Unable to load configuration # 'file:/Users/john/Development/groovy/gradlegebautomation/build/resources/test/GebConfig.groovy' (with environment: null)
so i'm probably off on this but i'd try to give it a choice as to which environment to use, say .environment('firefox') - sorry forgot the syntax

Resources