Tag Archives: )

[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

pymysql.err.OperationalError: (1054, “Unknown column’aa’in’field list’)

Error Description:

Today, when using Python to connect to MySQL database for data addition, an error “pymysql. Err. Operationalerror: (1054,” unknown column ‘AA’ in ‘field list’) “appears. After query, it is because when pymysql inserts data, if it is of type vchar or string, it needs single quotation marks to insert successfully.

Solution:

Modify the SQL statement using the repr() function in Python:

Original SQL statement:

sql = "INSERT INTO student(name,sex,age,grade) VALUES ("+name+","+sex+","+age+","+grade+")"

Modified SQL statement:

sql_0="INSERT INTO student(name,sex,age,grade) VALUES (%s,%s,%s,%s)"
sql=sql_0 % (repr(name), repr(sex),repr(age),repr(grade))

 

SDK manager cannot open the solution (Android)

Solution 1:
prompt [SDK manager] failed to convert path to a short DOS path: C: \ windows \ system32 \ java.exe
open tools \ lib \ find_ Java.bat file, find
for/F%% a in (‘%~dps0 \ find_java. Exe – s’) do set Java_ exe=%%a
for /f %%a in (‘%~dps0\find_java.exe -s -w’) do set javaw_ Exe =%% a
just remove the – s from it
for/F%% a in (‘%~dps0 \ find_java. Exe’) do set Java_ exe=%%a
for /f %%a in (‘%~dps0\find_java.exe -w’) do set javaw_ exe=%%a

Solution 2:
the SDK manager.exe cannot be opened because of the lack of environment variables. Let’s start setting the environment variables of Android.
right click, my computer — & gt; Properties — & gt; Advanced — & gt; Environment variable.
system variable, new, variable name: Android_ SDK_ Home, the variable value is the path you unzipped to Android SDK windows.
next, we find the path variable in the system variable, click Edit, and enter it in the variable value box.;% ANDROID_ SDK_ HOME%\platform-tools;% ANDROID_ SDK_ HOME%\tools;
two% middle representatives refer to Android_ SDK_ The path to home, and then add tools and platform tools

Solution 3:
open tools \ lib \ find_ Java.bat file:
REM check we have a valid java.exe in the path.
set Java_ exe=call lib\find_ java.bat
if not defined java_ Exe goto: EOF
REM here we set it directly and change it to the absolute path of java.exe on your computer
set Java_ Exe = “E: \ Java \ jdk1.6.0_45 \ bin \ Java. Exe”
REM comment out the following code, which is used to find the path of your java.exe,
REM call lib \ find_ Java. Bat
If “error: SWT folder ” does not exist… Error prompt appears
for/F%% a in (‘% java_exe% – jar lib \ archquery. Jar’) do set swt_path = lib \%% a
REM for/F%% a in (‘% java_exe% – jar lib \ archquery. Jar’) do set swt_path = lib \%% a
set swt_path = lib \ x86 change to your own swt.jar path
call% Java_ exe% %REMOTE_ DEBUG%” “-Dcom.android.sdkmanager.toolsdir=%tools_ dir%” “-Dcom.android.sdkmanager.workdir=%work_ dir%” -classpath “%jar_ path%;% swt_ path%\swt.jar” com.android.sdkmanager.Main %*

Solution 4:
SDK manager.exe confirm the path of java.exe by calling Android SDK windows \ tools \ lib \ find_java.bat.

Enable cmd.exe, switch the command line to Android SDK windows \ tools \ lib, execute find_java.bat, and see the output: C: \ windows \ system32 \ java.exe

Although java.exe exists in this path, it is not the installation path of JRE. It is estimated that it is because some software requiring Java copied java.exe, javaw.exe and javaws.exe to C: \ windows \ system32 during installation, resulting in SDK manager.exe calling java.exe at the wrong location.

Delete java.exe, javaw.exe and javaws.exe under C: \ windows \ system32 \.

Solution 5: the installation path of Android SDK cannot have Chinese, and the installation folder cannot have spaces

Solution 6:

1、 First, ensure that the system variables of JDK and JRE are set correctly. For details, refer to the link: http://www.cnblogs.com/smyhvae/p/3788534.html

2、 Replace tools folder

Go to the website: http://tools.android-studio.org/index.php/sdk Download tools resources from

After downloading, unzip and install it under the tools file, and replace the file

 

 

Modify the script execution permission of PowerShell, and solve the problem of error reporting of commands executed by built-in terminals such as vscode (XX cannot recognize the name of cmdlets, functions, script files or runnable programs)

Several permissions for running PowerShell scripts

1. Restricted: by default, no script is allowed to run

2. Allsigned: only scripts signed by digital certificates can be run

3. Remotesigned: running a local script does not require a digital signature, but running a script downloaded from the network must have a digital signature

4. Unrestricted: all scripts are allowed to run, but you will be prompted whether to operate before running

5. Bypass: allow all scripts to run without any prompts and warnings.

View current permissions

Get-ExecutionPolicy

Modify permissions

set-ExecutionPolicy RemoteSigned

 

Super detail: command not found: the scratch solution (add the scratch environment variable to Zsh under MAC)

Background: originally, I planned to create a crawler project with scratch, but it showed Zsh: command not found: scratch . After reading many blogs, I solved the problem and decided to record it.

Main reference Blogs:

    https://www.jianshu.com/p/51196153f804

    https://stackoverflow.com/questions/17607944/scrapy-not-installed-correctly-on-mac

Problem analysis:

When I reinstall the script, I show:

WARNING: The script scrapy is installed in 
'/Library/Frameworks/Python.framework/Versions/3.9/bin' which is not on PATH.
  Consider adding this directory to PATH 
  or, if you prefer to suppress this warning, use --no-warn-script-location.

Note /library/frameworks/python.framework/versions/3.9/bin is not in the path. We need to add this path to the environment variable (consumer adding this directory to path).

terms of settlement:

Step 1: add source ~ /. Bash at the end of the. Zshrc file_ profile

    Open the finder, press Command + Shift + G, enter. Zshrc, open the. Zshrc file, and then write source ~ /. Bash at the end of the file_ profile

    Press Command + s to save

    Open the terminal, enter source ~ /. Zshrc , and execute the file.

Step 2: in. Bash_ Add environment variables to the profile file

    Open the finder, press Command + Shift + G at the same time, and enter. Bash_ Profile, open. Bash_ Profile file.

    Write on the last line:

    export PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:$PATH"

    be careful ⚠️: The number after versions is the python version number. It should be modified according to your own Python version. If the version is 2.7, it should be changed to:

    export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH"

    Press Command + s to save.

    Open the terminal and enter source ~ /. Bash_ Profile , execute the file.

    Finally, you can enter echo $path on the terminal to see if the environment variable is added.

    You can see that /library/frameworks/python.framework/versions/2.7/bin has been added ( and many ).

    Finally, enter scapy and you can finally use it!!!

Unknownhostexception: XXX, an error is reported when using the Nacos remote call service (load balancing)

Remember, this kind of error occurs in the future because @ loadbalanced is not added to the getresttemplate () method in the configuration file of the consumer side to enable the load balancing function, so Nacos reports the error of “no host found”!

The front-end request error page is as follows:

 

Cause analysis:

1. First of all, Nacos has its own load balancing function. Why?Please see the figure below:

 

2. Because Nacos integrates ribbon, you can use resttemplate to remotely call the service for load balancing, and then successfully find the service under the Nacos registration service center. You just don’t know what algorithm to use to select the service provider, so an error is reported – no host exception is found.

 

  Solution:

Add “@ loadbalanced” above the method to get resttemplate in the configuration file to enable the load balancing function.

Done!

Install the specified version of tensorflow (I reported an error)

The installation commands are as follows:

pip install tensorflow-gpu==1.10.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

Use it with caution. Anyway, I made a mistake and haven’t found an effective solution

The specified module could not be found

Oserror: [winerror 126] the specified module could not be found

 

On September 9, 2019, the problem has been solved and will be updated when possible

Maven does not have a servlet (an error is reported after the servlet is created)

 Maven cannot create a servlet

Solution

Scheme I

Specify the root directory in the IML of the project

 <sourceRoots>
        <root url="file://$MODULE_DIR$/src/main/java" />
  </sourceRoots>

Scheme II

Successfully solved

Error when Maven creates Servlet

Solution

Add in pom.xml (add dependencies under dependencies)

<!-- JSTL -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    <!-- Servlet -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <!--JSP -->
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>

Successfully resolved

 

Authentication for user Weblogic denied when Weblogic starts managed server

How did “people you might know” find you on social software>>>

Weblogic starts the managed server to report an error authentication for user Weblogic denied

Reference article:

(1) Authentication for user Weblogic denied when Weblogic starts managed server

(2) https://www.cnblogs.com/shelly01-zhou/p/6210736.html

Let’s make a note.