Tag Archives: Bug resolution

Error Cannot find module ‘worker_threads‘ [How to Solve]

Error: Cannot find module ‘worker_ ‘threads’ solution

Try vite to create Vue project for the first time, and run NPM run dev with an error

This is a node version problem. Version 12 or above is required

PS D:\qian_duan-learn\vue3-learn\vue3demo02> node -v
v10.13.0
PS D:\qian_duan-learn\vue3-learn\vue3demo02> 

Just upgrade the node version

npm install -g n (mac need to add sudo)
n latest

Of course, it is more recommended that you use NVM to install multiple node versions to meet the requirements of different projects

[Solved] org.thymeleaf.exceptions.TemplateInputException: Error resolving template

This problem occurs when spring boot} integrates thymeleaf

By querying other people’s blogs. I understand that there are several possible errors

1 when the method corresponding to your controller layer returns the HTML path and name, add an additional /.

For example, return “/index”. If this ‘/’ causes an error, the solution is to remove the ‘/’ in front of the return, such as return “/index”

2. Introduction package problem (I solved it this way)

Add dependency in porn

<dependency> 
<groupId>net.sourceforge.nekohtml</groupId> 
<artifactId>nekohtml</artifactId> 
<version>1.9.22</version> 
</dependency>

[Solved] hbase Startup Error: ERROR: Can’t get master address from ZooKeeper; znode data == null

Start HBase normally, but an error is reported with the list command:

ERROR: Can’t get master address from ZooKeeper; znode data == null

Here is some help for this command:
List all user tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:

hbase> list
hbase> list ‘abc.’
hbase> list ‘ns:abc.’
hbase> list ‘ns:.*’

Check the log file of HBase first, and the following error appears:
2021-12-08 23:51:35101 fat [hadoop01:16000. Activemastermanager] master HMaster: Failed to become active master
org. apache. hadoop. ipc. RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby

Solution:
① it is related to the active and standby of the node. In my case, there are three highly available Hadoop, of which the primary node Hadoop 01 is standby and Hadoop 02 is active, but errors will still be reported. I actively intervene in the zookeeper election, set Hadoop 01 to active and Hadoop 02 to standby, and the result is successful.
actively intervene in the zookeeper election command:

hdfs haadmin -transitionToStandby --forcemanual nn2
hdfs haadmin -transitionToActive --forcemanual nn1

② High availability Hadoop core site XML configuration

and HBase site XML doesn’t match. I configured HBase before the high availability configuration and didn’t change it later, so I had to change it.

after modification:

then put the Hadoop cluster configuration file core site XML and HDFS site The two configuration files, XML, are copied to the conf directory of HBase

Restart Hadoop cluster and HBase

How to Solve creating bean with name ‘mappingjackson2httpmessageconverter’ error when elasticsearch advanced client starts‘

When learning elasticsearch, write the code to ehcahce index. When starting the project, an error is reported in the error creating bean with name ‘mappingjackson2httpmessageconverter’.

So I looked for the jar package in lib and found that Jackson’s package was introduced. However, no dependency is introduced into the POM file. I checked the related dependencies and found that they were introduced from the high-level client

It seems to be a necessary package for elastic advanced client. To test this conjecture, I deleted all the jar packages of Jackson and started it. The project did start successfully, but an error occurred when sending the index request, that is, in this line of code indexrequest.Source (JSON).

It seems that it is a necessary package. But I didn’t find the right answer on the Internet. To solve this problem, I manually introduced Jackson into

Then delete all the jar packages that do not belong to my imported Jackson.
the red box part is the jar package I manually imported, and the blue part is the jar package automatically imported by the advanced client. Manually delete the jar package in blue. The measured items can be started normally and the index request can be sent

However, there is a fatal problem, that is, if reload maven, the jar package in the blue part will be automatically introduced. To solve this problem, we must first find out which jar packages are introduced into our POM file, and then ignore these jar packages using the exclusion method. Finally, my POM file is shown below


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.3.12.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.datatype</groupId>
                    <artifactId>jackson-datatype-jdk8</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.datatype</groupId>
                    <artifactId>jackson-datatype-jsr310</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml</groupId>
                    <artifactId>jackson-xml-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.dataformat</groupId>
                    <artifactId>jackson-dataformat-smile</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.dataformat</groupId>
                    <artifactId>jackson-dataformat-yaml</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.dataformat</groupId>
                    <artifactId>jackson-dataformat-cbor</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- json包 -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
    </dependencies>

[Solved] Pycharm Use pip Error: Script file ‘D:\Anaconda3\envs\pytorch\Scripts\pip-script.py‘ is not present

Problem Description:

error reporting 1: error reporting for PIP installation: script file’d:\anaconda3\envs \ pytorch\scripts\PIP script. Py ‘is not present.
error reporting 2: PIP upgrade failed: script file’d:\anaconda3\envs\pytorch\scripts\PIP script. Py’ is not present.
as shown in the following figure:


Solution:

Baidu has had the following solutions for a long time:

# Method 1: Use the command line to go to the Anconda3\Scripts\ directory and execute the command, or if it is a virtual environment, go to the \Scripts\ directory under the virtual environment

    easy_install pip # I tried this method, but it didn't work for me 
    
# Method 2: Also go to the directory and execute the following statement

    python -m ensurepip --default-pip # Perfect solution

NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError [Solved]

After setting up the spring security oauth2 environment, conduct interface test with postman:

Postman returned an error message:

The idea console outputs the following warnings:

WARN 4344 — [nio-8082-exec-1] o.s.s.o.provider.endpoint.TokenEndpoint  : Handling error: NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError

After investigation, it is found that a method in the spring security configuration class securityconfiguration written by myself is wrong and written as: AuthenticationManager. The correct method name should be authenticationmanagerbean.

The complete and correct method is:

@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
      return super.authenticationManagerBean();
}

Retest after modification and return the correct result:

If you encounter any problems during browsing, please leave me a message in the comment area below.

io.UnsupportedOperation : not writable exception resolution

Today, when doing Python language sense exercise, I reported the following exception:

is the red exception
this is the red exception io.UnsupportedOperation : not writable

Write permission is not supported. After a careful inspection, I found that I forgot to set the permissions when I opened the file for the first time, so after I added it, the program ran successfully!!!