When I execute the groovy script in JSR223 Post processor,I get the following error.The script works fine with earlier version but when upgraded to Jmeter5.4.2 it throws this error.
021-12-20 19:47:02,491 WARN o.a.j.f.Groovy: Error running groovy script
javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: AESUtil for class: Script4
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:162) ~[groovy-all-2.4.16.jar:2.4.16]
at javax.script.AbstractScriptEngine.eval(Unknown Source) ~[?:1.8.0_201]
at org.apache.jmeter.functions.Groovy.execute(Groovy.java:120) [ApacheJMeter_functions.jar:5.4.2]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:138) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:113) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:100) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(AbstractTestElement.java:280) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getPath(HTTPSamplerBase.java:508) [ApacheJMeter_http.jar:5.4.2]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getUrl(HTTPSamplerBase.java:1079) [ApacheJMeter_http.jar:5.4.2]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296) [ApacheJMeter_http.jar:5.4.2]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285) [ApacheJMeter_http.jar:5.4.2]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.2]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.2]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
Caused by: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: AESUtil for class: Script4
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:324) ~[groovy-all-2.4.16.jar:2.4.16]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:159) ~[groovy-all-2.4.16.jar:2.4.16]
... 15 more
Caused by: groovy.lang.MissingPropertyException: No such property: AESUtil for class: Script4
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) ~[groovy-2.4.6.jar:2.4.6]
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52) ~[groovy-2.4.6.jar:2.4.6]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) ~[groovy-2.4.6.jar:2.4.6]
at Script4.run(Script4.groovy:1) ~[?:?]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:321) ~[groovy-all-2.4.16.jar:2.4.16]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:159) ~[groovy-all-2.4.16.jar:2.4.16]
... 15 more
You "Can't able to run Groovy script in Jmeter" because you're trying to use AESUtil class (whatever it is) and the class is not known to JMeter/Groovy
In order to be able to use AESUtil class you need to put it under JMeter Classpath (copy the .jar providing the class to "lib" folder of your JMeter installation)
Also looking into dependencies for JMeter 5.4.2 it seems that JMeter uses groovy version 3.0.7 and from your log file it appears that you're having groovy-all-2.4.16.jar so I would recommend removing it from JMeter Classpath in order to avoid potential Jar Hell
More information: How to Reuse Your JMeter Code with JAR Files and Save Time
Related
I'm trying to send HTTP2 requests via JMeter.
I've downloaded alpn-boot file according to my java version: java version "1.8.0_151" -> ALPN version is 8.1.11.v20170118 (according to https://www.eclipse.org/jetty/documentation/9.4.x/alpn-chapter.html#alpn-versions). Also, I've added the path to alpn-boot file to jmeter.bat:
set JVM_ARGS= -Xbootclasspath/p:D:\apache-jmeter-5.1\apache-jmeter-5.1\lib\alpn-boot-8.1.11.v20170118.jar
#echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
...
But I get an error message in JMeter:
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No Client ALPNProcessors!
at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:138)
at com.blazemeter.jmeter.http2.sampler.HTTP2Connection.connect(HTTP2Connection.java:69)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.setConnection(HTTP2Request.java:280)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:140)
at com.blazemeter.jmeter.http2.sampler.HTTP2Request.sample(HTTP2Request.java:117)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: No Client ALPNProcessors!
at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:57)
at org.eclipse.jetty.http2.client.HTTP2Client.lambda$doStart$1(HTTP2Client.java:155)
at org.eclipse.jetty.http2.client.HTTP2Client$ClientSelectorManager.newConnection(HTTP2Client.java:438)
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:222)
at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:825)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:754)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:672)
... 1 more
Suppressed: java.lang.NoClassDefFoundError: org/eclipse/jetty/alpn/ALPN
at org.eclipse.jetty.alpn.java.client.OpenJDK8ClientALPNProcessor.init(OpenJDK8ClientALPNProcessor.java:42)
at org.eclipse.jetty.alpn.client.ALPNClientConnectionFactory.<init>(ALPNClientConnectionFactory.java:77)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.alpn.ALPN
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
I guess the issue is connected with alpn path in jmeter.bat file, but how to correct it?
First of all ensure that JMeter is using your Java 1.8.0_151 and taking the -Xbootclasspath argument, you can do this by adding a JSR223 Sampler and using the following Groovy code:
log.info('Java version: ' + System.getProperty('java.version'))
java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments().each {
log.info("Effective JVM argument: " + "$it")
}
you should get the output like:
Check that the alpn-boot file is really there:
Sanitize the input, i.e. remove whitespace, add a semicolon at the end and surround the value with quotation marks:
set JVM_ARGS="-Xbootclasspath/p:D:\apache-jmeter-5.1\apache-jmeter-5.1\lib\alpn-boot-8.1.11.v20170118.jar;"
If everything goes well you should be able to successfully execute the HTTP2 request:
More information: The New HTTP/2 Plugin for JMeter
I'm trying to run a JMeter test and I keep getting the error listed below. I'm running in non-gui mode on an EC2 instance. I know I'm missing a .jar file and that's what is causing the error. But when I head over to Apache to look through their JMeter plugins, I can't find one that resolves this error.
2017-09-06 21:18:12,954 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.NoClassDefFoundError: kg/apc/jmeter/JMeterPluginsUtils
at kg.apc.jmeter.PluginsCMDWorker.<init>(PluginsCMDWorker.java:51) ~[jmeter-plugins-cmd-2.1.jar:?]
at kg.apc.jmeter.listener.GraphsGeneratorListener.testEnded(GraphsGeneratorListener.java:146) ~[jmeter-plugins-graphs-ggl-2.0.jar:?]
at kg.apc.jmeter.listener.GraphsGeneratorListener.testEnded(GraphsGeneratorListener.java:137) ~[jmeter-plugins-graphs-ggl-2.0.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:230) ~[ApacheJMeter_core.jar:3.2 r1790748]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:498) ~[ApacheJMeter_core.jar:3.2 r1790748]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
Caused by: java.lang.ClassNotFoundException: kg.apc.jmeter.JMeterPluginsUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_141]
Your JMeter Plugins installation is corrupt, double check you have jmeter-plugins-cmn-jmeter-0.3.jar file in the "lib" folder of your JMeter installation. If not - you will have to re-install JMeterPluginsCMD Command Line Tool
Be aware that recommended way of installing JMeter Plugins and keeping them up-to-date is using JMeter Plugins Manager
If you are running in Non-UI mode just remove the plugin element from your jmx file.
I'm trying to run a load test using the Visual Studio Online support for JMeter tests. I'm getting an error below. I tried these 2 settings but with the same results
<stringProp name="CookieManager.implementation">org.apache.jmeter.protocol.http.control.HC3CookieHandler</stringProp>
<stringProp name="CookieManager.implementation">org.apache.jmeter.protocol.http.control.HC4CookieHandler</stringProp>
based on the advice from here
Unable to load or invoke class:
org.apache.jmeter.protocol.http.control.HC3CookieHandler
org.apache.jorphan.util.JMeterException:
java.lang.reflect.InvocationTargetException at
org.apache.jorphan.reflect.ClassTools.construct(ClassTools.java:112)
at
org.apache.jmeter.protocol.http.control.CookieManager.testStarted(CookieManager.java:397)
at
org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:214)
at
org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:336)
at java.lang.Thread.run(Unknown Source) Caused by:
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.apache.jorphan.reflect.ClassTools.construct(ClassTools.java:100)
... 4 more Caused by: java.lang.IllegalStateException: Unsupported
cookie spec standard at
org.apache.commons.httpclient.cookie.CookiePolicy.getCookieSpec(CookiePolicy.java:220)
at
org.apache.jmeter.protocol.http.control.HC3CookieHandler.(HC3Coo
I think I found my answer it seems vs-team-services only supports Apache JMeter 2.13
I am getting an error as it is not able to initialize the ANT location although it's a Maven project.
For Jenkins job.
The output can be found below:
[htmlpublisher] Archiving HTML reports... [htmlpublisher] Archiving at
PROJECT level
C:\Jenkins\workspace\Capybaras-STAGE-Regression-OnDemand\target\dashboard-reports
to
/home/scmbuildmaster/.jenkins/jobs/Capybaras-STAGE-Regression-OnDemand/htmlreports/Dashboard_Full_Report_with_Screenshot FATAL: HTML Publisher failure java.io.IOException:
java.util.concurrent.ExecutionException:
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.tools.ant.Location at
hudson.FilePath.copyRecursiveTo(FilePath.java:2213) at
hudson.FilePath.copyRecursiveTo(FilePath.java:2101) at
hudson.FilePath.copyRecursiveTo(FilePath.java:2084) at
htmlpublisher.HtmlPublisher.perform(HtmlPublisher.java:213) at
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183) at
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1784) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at
hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240) Caused by:
java.util.concurrent.ExecutionException:
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.tools.ant.Location at
hudson.remoting.Channel$3.adapt(Channel.java:784) at
hudson.remoting.Channel$3.adapt(Channel.java:779) at
hudson.remoting.FutureAdapter.get(FutureAdapter.java:55) at
hudson.FilePath.copyRecursiveTo(FilePath.java:2211) ... 12 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.apache.tools.ant.Location at
org.apache.tools.ant.ProjectComponent.(ProjectComponent.java:43)
at org.apache.tools.ant.types.DataType.(DataType.java:40) at
org.apache.tools.ant.types.AbstractFileSet.(AbstractFileSet.java:82)
at org.apache.tools.ant.types.FileSet.(FileSet.java:36) at
hudson.Util.createFileSet(Util.java:1077) at
hudson.util.DirScanner$Glob.scan(DirScanner.java:124) at
hudson.FilePath.writeToTar(FilePath.java:2249) at
hudson.FilePath.access$2100(FilePath.java:191) at
hudson.FilePath$45.invoke(FilePath.java:2190) at
hudson.FilePath$45.invoke(FilePath.java:2186) at
hudson.FilePath$FileCallableWrapper.call(FilePath.java:2665) at
hudson.remoting.UserRequest.perform(UserRequest.java:121) at
hudson.remoting.UserRequest.perform(UserRequest.java:49) at
hudson.remoting.Request$2.run(Request.java:324) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
hudson.remoting.Engine$1$1.run(Engine.java:63) at
java.lang.Thread.run(Unknown Source) at ......remote call to
QA-Automation-Node(Native Method) at
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at
hudson.remoting.Channel$3.adapt(Channel.java:782) ... 15 more Build
step 'Publish HTML reports' changed build result to FAILURE
Try the following, in the following order:
Try to upgrade the JRE version that you use to run the slave process
If you are using a JRE to run your slave, use a JDK If you are using
an OpenJDK, try with an Oracle JDK
I'm trying to build a load test for my queues, which are Weblogic Queues, but I can't figure out which weblogic libraries I need for this. At least, that's what I think my problem is (because I get ClassNotFoundExceptions). I've already copied
weblogic.jar
wlclient.jar
wljmsclient.jar
into my jMeter/lib directory.
but I still get ClassNotFoundError like:
Response message: java.lang.NoClassDefFoundError: weblogic/utils/collections/ConcurrentHashMap
Here, also the full stacktrace...
2014/09/16 19:17:19 ERROR - jmeter.protocol.jms.sampler.JMSSampler: weblogic/utils/collections/ConcurrentHashMap java.lang.NoClassDefFoundError:
weblogic/utils/collections/ConcurrentHashMap
at weblogic.jndi.spi.EnvironmentManager.<clinit>(EnvironmentManager.java:19)
at weblogic.jndi.Environment.getContext(Environment.java:307)
at weblogic.jndi.Environment.getContext(Environment.java:277)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.getInitialContext(JMSSampler.java:424)
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:319)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:597)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:566)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:554)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: weblogic.utils.collections.ConcurrentHashMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 17 more
2014/09/16 19:17:19 WARN - jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateExcepti
on: Session may not be null while creating message
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:179)
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:140)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
at java.lang.Thread.run(Thread.java:662)
... and, also my JMeter Configuration:
After the first run I get the following error: ConcurrentHashMap not found
And on every run after the first one: EnvironmentManager can't be initialized
What am I not doing right here? Thanks a lot for the help!
Regards,
al
According to http://mazanatti.info/index.php?/archives/68-JMeter-configure-and-post-JMS-messages-to-Weblogic-Server.html you probably need wlthint3client.jar instead of weblogic.jar and wlclient.jar
Combo of wljmsclient.jar and wlthint3client.jar works for me.