Getting Error 500 in SMTP sampler in JMeter - jmeter

I am getting this error while running the SMTP Sampler in JMeter:
Response code: 500
Response message: IOException while sending message
And I got the following in the logs:
javax.mail.MessagingException: IOException while sending message at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1167)
~[mail-1.5.0-b01.jar:1.5.0-b01] at
org.apache.jmeter.protocol.smtp.sampler.protocol.SendMailCommand.execute(SendMailCommand.java:303)
~[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.protocol.smtp.sampler.SmtpSampler.executeMessage(SmtpSampler.java:169)
[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.protocol.smtp.sampler.SmtpSampler.sample(SmtpSampler.java:146)
[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491)
[ApacheJMeter_core.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425)
[ApacheJMeter_core.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
[ApacheJMeter_core.jar:3.2 r1790748] at java.lang.Thread.run(Unknown
Source) [?:1.8.0_201] Caused by: java.io.FileNotFoundException: V:\001
Automation\Automation Scripts\Test Plan\Cloud\Final\Priority 6 -
Process (Access is denied) at java.io.FileInputStream.open0(Native
Method) ~[?:1.8.0_201]
What would probably the cause of the issue and how it will be resolved?

According to the error message JMeter cannot access the following file:
V:\001 Automation\Automation Scripts\Test Plan\Cloud\Final\Priority 6 - Process
make sure to amend the permissions to the file and make sure the user account under which you're running JMeter has access to the given file.
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.1 (or whatever is the latest stable version which is available at JMeter Downloads page) as soon as possible.

Related

Getting error - "java.io.IOException: Premature EOF" in JMeter

I am using JMeter 5.4.1, where I am using a HTTP request for Post API call. I am getting the error - "java.io.IOException: Premature EOF".
Keep-Alive is checked. Timeouts are also set to 60 Seconds. I am using single thread.
What is the solution to get raid of this?
java.io.IOException: Premature EOF
at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)
at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)
at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:102)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1936)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:530)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:296)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:567)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)
It's hard to say what's wrong, looking into the error it seems that you're getting an incomplete response.
If you can successfully execute this API call using browser or other API testing tool like SoapUI - make sure that JMeter sends the same HTTP Headers via HTTP Header Manager
You can also increase JMeter debug logging verbosity by adding the next line to log4j2.xml file
<Logger name="org.apache.jmeter.protocol.http" level="debug" />
JMeter restart will be required to pick the change up, once done you can check jmeter.log file for any suspicious entries
And last but not the least try switching to HttpClient4 implementation, the setting lives at "Advanced" tab of the HTTP Request sampler

HTTP2 Request cannot be send via JMeter

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

JMeter throws java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)

2017-09-29 12:39:56,306 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-29 12:39:56,307 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-29 12:39:56,312 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.NoSuchMethodError:
org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)
at kg.apc.jmeter.JMeterPluginsUtils.doBestCSVSetup(JMeterPluginsUtils.java:256) ~[jmeter-plugins-cmn-jmeter-0.3.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.setupSaving(PerfMonCollector.java:136) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(PerfMonCollector.java:113) ~[jmeter-plugins-perfmon-2.1.jar:?]
at org.apache.jmeter.reporters.ResultCollector.testStarted(ResultCollector.java:355) ~[ApacheJMeter_core.jar:3.2 r1790748]
at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(CorrectedResultCollector.java:28) ~[jmeter-plugins-cmn-jmeter-0.3.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:218) ~[ApacheJMeter_core.jar:3.2 r1790748]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:388) ~[ApacheJMeter_core.jar:3.2 r1790748]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_65]
As per UBIK LOAD PACK 's answer and Subho comment above:
For Jmeter 3.3 and jpgc-perfmon-2.1 (latest versions as I write), after the install of the perfmon zip file into Jmeter, you need to:
- remove the jmeter-plugins-cmn-jmeter-0.3.jar from the /lib directory
- and replace it with jmeter-plugins-cmn-jmeter-0.4.jar (available from Maven Central).
Thanks so much guys! Spent hours on this (I dont have enough reputation to just add a comment to UBIKs answer)
You are using a version of Perfmon plugin which is incompatible with Apache JMeter version as per this message:
java.lang.NoSuchMethodError:
org.apache.jmeter.samplers.SampleSaveConfiguration.setFormatter(Ljava/text/DateFormat;)
So either update jmeter-plugins perfmon plugin or downgrade your jmeter.

JMeter: No Class Def Found Error: kg/apc/jmeter/JMeterPluginsUtils

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.

jmeter Received fatal alert: bad_record_mac https site

I'm new here, I'm having this issue using JMeter proxy while I'm trying to open a site https, it only occurs with the login page, the other pages load correctly, any help? Thanks!
I'm using jmeter proxy and the browser is firefox.
javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:436)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:236)
It looks like that your jmeter configuration doesn't match your server configuration. This error usually indicates that SSLv3 enabled server is being tested using wrong SSL protocol from JMeter load generator side.
As far as I recall it defaults to TLS and it can be changed i.e. by adding following line to user.properties file which resides under /bin folder of your JMeter installation:
https.default.protocol=SSLv3
Alternatively you can launch JMeter providing this property as a command-line argument to JMeter startup script as follows:
jmeter -Jhttps.default.protocol=SSLv3 -n -t your.script.jmx -l your.script.log.jtl
See Apache JMeter Properties Customization Guide for more information on JMeter Properties and ways to play with them.
Hope this helps.
I assume you get this error while running/executing your test and not while recording the login scenario.
please check the following:
Click on the HTTP sampler for Login request
Check the PORT Number, since it is an https request it should be generally 443.
Hope this will help.

Resources