Tag Archives: Jmeter

[Solved] JMeter Generate the report of html Error

Error generating the report: org. apache. jmeter. report. dashboard. GenerationException: Error while processing samples: Consumer failed with message :Consumer failed with message :Consumer failed with message :Consumer failed with message :Begin size 0 is not equal to fixed size 5

The jdk I installed at first was jdk-17_linux-x64_bin.rpm which is jdk 17. When I generated the html report from the jtl file, I got the above error.

Later uninstalled the jdk. I reinstalled jdk1.8, jdk-8u202-linux-x64.rpm, and it generated it normally.

The uninstallation method of rpm is attached:

1. Check the version of JDK:

rpm -qa | grep jdk

2. Uninstall the JKD version installed by rpm

rpm -e –nodeps jdk1.8-1.8.0_202-fcs.x86_64

The conclusion is: it should be the compatibility problem of version 17 JDK. Try to change the JDK.

Execute the Jmeter Script Error: .org.apache.http.conn.httphostconnectexception: XXXX failed: unable to specify the solution of the requested address (Connect failed)

Problem Description: While executing a single transaction load script, I found that running the script locally, the exception rate was 0%, and when the same script was executed on the hair press, there were large error reports.

Reason: Linux allocate to the client connection port exhausted, can not establish a socket connection caused by, although the socket closed, but the port default wait for 60s to be released, so as long as we give more available ports will be fine.

Solution steps.

1. Check the range of client connection ports supported by Linux: cat /proc/sys/net/ipv4/ip_local_port_range

2. Tune down the waiting time after port release, the default is 60s, modify it to 15~30s: echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

3. Modify the tcp/ip protocol configuration by configuring /proc/sys/net/ipv4/tcp_tw_reuse, the default is 0, modify it to 1 to release the TIME_WAIT port for new connections: echo 1 > /proc/sys/net/ipv4/tcp_tw_resue

4. Modify the tcp/ip protocol configuration to quickly recycle socket resources, the default is 0, modify it to 1: echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

After the modification, execute the single transaction load script on the issuing press again, and the exception rate is normal.

[Solved] JMeter pressure test error: Java net. BindException: Address already in use: connect

Recently, I was writing a search interface service. After writing the interface, I conducted a stress test. However, when testing with a high thread for a long time, the following errors will be reported:

Troubleshooting:

First, check the server log and find that there are no errors.

Then check the nginx data. It is found that the number of requests is inconsistent with the number of requests sent by the test. The server receives less and thinks of losing requests.

Later, after searching the information, it was found that it was the problem of the windows machine,

Reason: Windows provides 1024-5000 ports for TCP/IP links, and it takes four minutes to recycle them, which causes us to fill up the ports when running a large number of requests in a short time, resulting in an error report.

Solution (operate on the server where JMeter is located):

1. Enter regedit command in CMD to open the registry;

2. In HKEY_LOCAL_Machine\system\currentcontrolset\services\TCPIP\parameters right-click parameters;

3. Add a new DWORD named maxuserport;

4. Double click maxuserport, enter 65534 numerical data, and select decimal base;

5. After completing the above operations, be sure to restart the machine and solve the problem.

No error will be reported for the test results after solution:

Add: I can test normally after modifying the above problems, but the same problem occurs after increasing the number of threads two days. The following configuration will test normally.

After the above three steps, add tcptimedwaitdelay, the value is 30-300, and select decimal.

You still need to restart your computer

[Solved] jmeter Start Error: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]

new downloaded jmeter, starting reward:

First, you can see ERROR o.a.j.JMeter: Uncaught exception in thread Thread

2021-10-13 20:27:42,010 INFO o.j.r.PluginManager: Plugins Status: [jpgc-plugins-manager=1.6, jmeter-core=5.4.1, jmeter-ftp=5.4.1, jmeter-http=5.4.1, jmeter-jdbc=5.4.1, jmeter-jms=5.4.1, jmeter-junit=5.4.1, jmeter-java=5.4.1, jmeter-ldap=5.4.1, jmeter-ldap=5.4.1, jmeter-ldap=5.4.1 eter-mail=5.4.1, jmeter-mongodb=5.4.1, jmeter-native=5.4.1, jmeter-tcp=5.4.1, jmeter-components=5.4.1]
2021-10-13 20:27:54,241 INFO o.a.j.s.FileServer: Default base=’/Users/kidd’
2021-10-13 20:27:54,243 INFO o.a.j.a.Load: Loading file: /Users/kidd/jmetertesting_file/View Results Tree.jmx
2021-10-13 20:27:54,244 INFO o.a.j.s.FileServer: Set new base=’/Users/kidd/jmeteretereter testing_file’
2021-10-13 20:27:54,383 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2021-10-13 20:27:54,391 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0
2021-10-13 20:27:54,392 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
2021-10-13 20:27:54,394 INFO o.a.j.s.SaveService: Loading file: /Users/kidd/jmetertesting_file/View Results Tree.jmx

*

Resistance: reconstruction, issue is completely resolved.

*

*

Error in JMeter import JMX file cannotresolveclassexception: kg.apc.jmeter.perfmon.perfmoncollector solution

When using jmeter5.1.1 to import external scripts today, you will be prompted with an error message: cause: cannotresolveclassexception: kg.apc.jmeter.perfmon.perfmoncollector detail: com.thoughtworks.xstream.converters.conversionexception: — debugging information —- cause exception: com.thoughtworks.xstream.converters.conve

 

Cause: the jar package is missing, but we don’t know which one is missing, so we can go to the official website to download the JMeter plug-in manager, let the manager automatically detect the necessary jar package when importing JMX files, and then click Install to download automatically.

1. JMeter plug-in manager download address: https://jmeter-plugins.org/install/Install/

 

2. Put the plug-ins in this folder

 

3. Restart JMeter, drag the script into, and you will be prompted to install

 

4. JMeter restarts and completes the script import

[Solved] JMeter startup error: integer expression expected

After installing jmeter, the following error message appears during the process of starting Jmeter (mostly due to incorrect configuration).

/usr/local/Cellar/jmeter/5.1.1/libexec/bin/jmeter: line 128: [: : integer expression expected

/usr/local/Cellar/jmeter/5.1.1/libexec/bin/jmeter: line 192: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java: No such file or directory

The information on the Internet indicates that my jdk version is not correct

1. Check the version of jdk on the local machine with the following command.

/usr/libexec/java_home -V

 

The input gave me an electric jdk version like:

The wrong jdk version is: jdk1.8.0_181

 

2, open.bash_profilefile to process, enter as follows:

vim .bash_profile

After opening the file, it is convenient to click the letter I for editing. After editing, press ESC to launch the editing mode, enter: WQ, exit, and then enter the following command on the terminal to really take effect

source ~/.bash_profile

After modification, execute at the terminal:

sudo sh jmeter

And then it started!

Now, I hope you have all the help

Solution of JMeter pressure test “Java. Net. Socketexception: socket closed”

Open source software supply chain lighting plan, waiting for you>>>

error reporting details:

java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
at java.lang.Thread.run(Thread.java:748)

Java.net.socketexception: socket closed error is usually caused by not setting the connection timeout

Solution:

This problem can be solved by the following methods

If use keepalive is checked in the basic of HTTP request sampler, it is recommended to use the Advanced tab:

1. Implementation is httpclient4

2. Connect in timeouts sets a value of 10-60 seconds, which indicates the idle timeout of the connection, so as to avoid the disconnection of the connection caused by the keep alive header that does not receive the response from the tested end

Reference:

https://help.aliyun.com/knowledge_ detail/112842.html

https://cwiki.apache.org/confluence/display/jmeter/JMeterSocketClosed?spm=a2c4g.11186623.2.16.41ff41eaJzLjlR

Solution of JMeter pressure test “Java.Net.Socketexception: socket closed”

Error:

java.net.SocketException: Socket closed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)

at java.net.SocketInputStream.read(SocketInputStream.java:171)

at java.net.SocketInputStream.read(SocketInputStream.java:141)

at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)

at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)

at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278)

at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)

at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)

at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)

at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286)

at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)

at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199)

at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212)

at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)

at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)

at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)

at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)

at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)

at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)

at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)

at java.lang.Thread.run(Thread.java:748)

The cause of the java.net.SocketException: Socket closed error is usually not setting a timeout for the connection. .

Resolution:

The issue can be tried to be solved by the following method.

If Use KeepAlive is checked in the Basic of the HTTP Request Sampler, then it is recommended that under the Advanced tab.

1, Implementation selected as HttpClient4

2, Timeouts in the Connect set a value of 10 ~ 60 seconds, indicating the idle timeout of the connection, to avoid disconnection due to not receiving the response back to the end

Solution to the problem of not able to find Java executable or version in JMeter installation

The following is the situation where I encountered this problem:

1. I lack jdk. Then I downloaded a 1.8 jdk.

2. Lack of environment variable configuration

Solve the problem one: Go to the official website to download.

Solve the problem two:

This is the directory where I installed jmeter:

This is the directory where I installed jdk

Start configuring environment variables:

They are:

classpath %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;D:\Java\jdk1.8.0_211\bin;D:\apache-jmeter-5.1.1\bin;

JAVA_HOME D:\Java\jdk1.8.0_211

JMETER_HOME D:\apache-jmeter-5.1.1

PATH %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

 

Note: Move %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin in the path to the forefront