Author Archives: Robins

How to Solve JMeter beanshellsampler error

1. Error calling BSH method: Eval

Error content: error – JMeter util. BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of: “import

The test in eclipse is normal, and the same code is put into JMeter to prompt errors

The first reason is that the data type cannot be specified in the map method, and the same is true in the list

After modifying the code, it will execute successfully

Reason 2: imported package error

Specific errors need to be analyzed and solved according to the returned error code.

2. The request returns an error message error invoking BSH method:

How to Solve:

1. Find the location of the Java source file and class file, eclipse -> Alt + enter can open the file path address

2. Configure the information in beanshellsampler collector and add addclasspaths import file without adding class file name. Fill in the path, as shown in the following figure:

[Solved] hive beeline Connect Error: User:*** is not allowed to impersonate

Beeline connection exception in hive user: * * * is not allowed to impersonate

1. Details of error reporting

When beeline connects hive, the following occurs:

The command causing the error is:

 bin/beeline -u jdbc:hive2://hadoop01:10000 -n root

2. Solutions

Restart the hadoop cluster after adding the configuration to /etc/hadoop/core-site.xml in the hadoop directory: (root is the username that reported the error)

<property>
        <name>hadoop.proxyuser.root.hosts</name>
        <value>*</value>
</property>
<property>
        <name>hadoop.proxyuser.root.groups</name>
        <value>*</value>
</property>

3. Reference

Hadoop2.0 version began to support the ProxyUser mechanism. The meaning is to use User A’s user authentication information to access the hadoop cluster in the name of User B. For the server, it is considered that User B is accessing the cluster at this time, and the corresponding authentication of the access request (including the permission of the HDFS file system and the permission of YARN to submit the task queue) is performed by the user User B.

Assume superuser user name super, you want to make the user joesubmit any and access hdfs. kerberos have superuser credentials, but the user joedoes not. Tasks need to be joerun as a user , and access to any files on the namenode must also be joedone as a user . Requires kerberos credentials that the user joecan use superto establish a connection to the namenode or job tracker. In other words, the superuser is being impersonating joe.

By core-site.xmlit is provided, superuser supercan and only from host1 and host2 to simulate the user belongs group1 and group2:

<property>
     <name>hadoop.proxyuser.super.hosts</name>
     <value>host1,host2</value>
</property>
<property>
     <name>hadoop.proxyuser.super.groups</name>
     <value>group1,group2</value>
</property>

In a workaround, the security requirements are not high, wildcards *can be used for impersonation (impersonation) from any host or any user, user root from any host can impersonate (impersonate) any user belonging to any group, there is no need to impersonate a user here , but created its own authentication information for the root user, the root user also has access to the hadoop cluster:

<property>
        <name>hadoop.proxyuser.root.hosts</name>
        <value>*</value>
</property>
<property>
        <name>hadoop.proxyuser.root.groups</name>
        <value>*</value>
</property>

nginx Server Start Error: nginx: [emerg] open() “/var/run/nginx/nginx.pid” failed (Linux Restart)

Question:

After Linux restarts, an error is reported when starting the nginx server

Solution:

1. Use the command CD/usr/local/nginx/conf to enter the specified directory

2. Use the command VI nginx Conf modify the configuration file # and remove the # number in the figure

3. Change to PID/usr/local/nginx/logs/nginx.pid;

4. Use the command MKDIR/usr/local/nginx/logs to create a directory

5. Start nginx service

[Solved] 1.4pip Install xgboost Error: Command errored out with exit status

If you can’t install it on pip, you can go to Python extension packages for windows – Christoph gohlke (UCI. EDU) to find what you need to install. For example, if I can’t install xgboost, search for xgboost here

Find the WHL file that matches your own Python Version (the file name and version supported by PIP), such as Python 3.0 represented by cp38.8;

You can enter Python – M PIP debug — verbose in CMD to view the file names and versions supported by your PIP:

After downloading the file, put the file in the same level directory of your Python running file and run PIP install # xgboost-1.5.1-cp38-cp38-win32.WHL (what I need is xgboost-1.5.1-cp38-cp38-win32.WHL)

[Solved] scss File Use the Depth Selector /deep/ Error: Expected selector

When using the latest version of hbuilder x editor to open the applet project built in the old version 3.2.3, the package/deep/error will occur. The previous question is vue3.0, then use vue2.0 does not report an error, and the latest version of hbuilder x editor seems to specify vite engineering by default. I’m tired of this

.mait-delegate{
    /deep/.uni-date__icon-clear {
        display: none !important;
    }
}

Change to

.mait-delegate{
    ::v-deep .uni-date__icon-clear {
        display: none !important;
    }
}

How to Solve .Net Core Class Library Import System.Windows.Forms Error

Net Framework framework references are mostly added directly on the Internet
But this method of packaging is very unfriendly

After going through the Microsoft documentation, I found a direct reference to the System. Froms assembly. It is also hidden deep, at: link

Net Core version >= 3.0

In fact, just modify the project’s csproj file

The original file

<Project Sdk=”Microsoft.NET.
<PropertyGroup
<TargetFramework>netcoreapp3.1</TargetFramework
<OutputType>Library</OutputType>
</PropertyGroup>
</Project>.
Modify the SDK in the first line

<Project Sdk=”Microsoft.NET.Sdk.WindowsDesktop”>
<PropertyGroup
<TargetFramework>netcoreapp3.1</TargetFramework
<OutputType>Library</OutputType>
</PropertyGroup>
</Project>.
Note this extra WindowsDesktop

Just add this reference to find System.Windows.

Springboot uses the Datetimeformat (pattern = “yyyy MM DD HH: mm: SS”) annotation to automatically convert the string to date type error

1.dto

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: htdd
 * @date: 2022/1/7 11:15
 */
@Data
public class TestDTO implements Serializable {

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}

2.controller

@PostMapping("test")
public JsonData test(HttpServletRequest request, @RequestBody TestDTO dto) {
    return JsonData.buildSuccess("success");
}

3. An error is reported after a postman request

Postman request

Background error reporting

Error reporting reason:

The general meaning is that the time format does not meet the requirements. After checking the document, the default conversion format for time is

"yyyy-MM-dd'T'HH:mm:ss.SSSZ"  
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"  
"EEE, dd MMM yyyy HH:mm:ss zzz"  
"yyyy-MM-dd"

Solution:

Unified configuration in configuration file

spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

4. Postman requests again and the conversion is successful

[Solved] remote: HTTP Basic: Access denied Authentication failed for ‘https://’

Solve the error reported by remote: http basic: access denied authentication failed for ‘HTTPS://’

The following error occurred while pushing the idea project:

Remote URL test failed:
 warning: ----------------- SECURITY WARNING ---------------- warning: 
| TLS certificate verification has been disabled! | 
warning: --------------------------------------------------- warning: 
HTTPS connections may not be secure. 
See https://aka.ms/gcmcore-tlsverify for more information. 
warning: ----------------- SECURITY WARNING ---------------- warning: 
| TLS certificate verification has been disabled! | 
warning: --------------------------------------------------- warning: 
HTTPS connections may not be secure. 
See https://aka.ms/gcmcore-tlsverify for more information. 
warning: ----------------- SECURITY WARNING ---------------- warning: 
| TLS certificate verification has been disabled! | 
warning: --------------------------------------------------- warning: 
HTTPS connections may not be secure. 
See https://aka.ms/gcmcore-tlsverify for more information. 
remote: HTTP Basic: Access denied Authentication failed for 'https://gitcode.net/CreativeAlliance/lottery-1502-guisi.git/'

I checked the problems on the Internet, and basically it was the user’s login error. The solutions are:

Check the account and password in GitHub to see if they were entered incorrectly before, and then re-enter them. My is to re-enter successfully

Windows may have recorded the wrong account and password. Find the saved GitHub account and password in the windows credential manager and delete them. Push again in idea, and then enter the account and password. 

The ultimate move, reinstall GIT and connect again

[Solved] Pandas Parses MovieLens 1M Dataset Error: UnicodeDecodeError

1. Problem description

When learning from books, I find that the data set downloaded from GitHub will report an error when reading with pandas:

2. Solutions

It is obviously a coding problem. Use the file command to view the file code:

ISO-8859 the code in Python is iso-8859-1, which can be judged by the following function:

pip install chardet

def get_encoding(file):
    with open(file, 'rb') as f:
        return chardet.detect(f.read())['encoding']

Therefore, use the encoding parameter to specify the actual file format.

it’s fine too

movies = pd.read_table('movies.dat', encoding=get_encoding('movies.dat'), sep='::', header=None, names=mnames, engine='python')