Category Archives: Error

[Solved] Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer‘ defined in class path re

Check the database configuration of redis

1. It may also be the configuration of local port number

2. Test whether the redis link can be tested

3. Is the effective address of the environment consistent with the current database address

Warning: for items that can be started normally, please do not modify the configuration and comments of the class where the startup item is located!

[Solved] CMake Error: The current CMakeCache.txt directory is different than xxx

CMake Error: The current CMakeCache.txt directory xxx/CMakeCache.txt
is different than the directory
xxx where CMakeCache.txt was created. This may result in binaries being
created in the wrong place. If you are not sure, reedit the
CMakeCache.txt CMake Error: The source
“xxx/CMakeLists.txt”
does not match the source
“xxx/CMakeLists.txt”
used to generate cache. Re-run cmake with a different source
directory.


You copied the project file, but the cache file in the build still retains the previous information. Just delete the build folder and recompile.

[Solved] ./configure: error: the HTTP rewrite module requires the PCRE library

report errors

./configure: error: the HTTP rewrite module requires the PCRE library.

Solution:

Install prce
official website: https://ftp.pcre.org/pub/pcre/

sudo wget https://udomain.dl.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.gz
sudo tar -zxvf pcre-8.45.tar.gz
cd pcre-8.45
sudo ./configure
sudo make && make install

Error:
configure: error: Invalid C++ compiler or C++ compiler flags

yum install -y gcc-c++

IE8 browser Webloader will always go uploaderror and report error: http

When using Baidu webloader, the IE8 browser will always use the uploaderror when debugging

uploader.on( 'uploadError', function( file,reason ) {
     alert(reason) ;
});

The reason error is http. The reason is:
the reason why JSON is returned when it is returned in the background.

The backend of webuploader cannot return json, convert json to string type, take com.alibaba.fastjson.JSONObject as an example,
com.alibaba.fastjson.JSONObject.toJSONString([json or object data]);

[Solved] c++: internal compiler error: Killed (program cc1plus)

@[TOC] (solution: C + +: internal compiler error: killed (program cc1plus))

1. Problems

Blogger installs sophus Library in VMware virtual machine, and an error occurs when executing make command, as shown in the following figure

2. Analyze problems

Multi party search to determine that the memory allocated to the Ubuntu system in VMware is too small. (the corresponding Ubuntu system installed on the physical machine is that the swap partition is too small)

3. Problem-solving

Shut down the virtual machine -> Increase virtual machine memory to 8g -> Re execute the make command -> Problem solving

[Solved] Error while extracting response for type [] and content type []…

When resttemplate is used to request restful interface, the returned JSON data will always be parsed into XML data for processing under specific circumstances, and then the error in the title will appear:

Error while extracting response for type [] and content type [application/xml;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ‘5’ (code 53) in content after ‘<‘ (malformed start element?).
at [row,col {unknown-source}]: [1,15395]; nested exception is com. fasterxml. jackson. databind. JsonMappingException: Unexpected character ‘5’ (code 53) in content after ‘<‘ (malformed start element?).

According to the error information, it seems that the response header marks the return type as [application/XML; charset = UTF-8], but the actual situation is that all the returned data is [application/JSON; charset = UTF-8].

After tracing the resttemplate source code, it is found that the instance created by new resttemplate (httprequestfactory()) will have 7 Converters:

Continue to track the exchange of the resttemplate. When performing type conversion on the response, all converters in the current instance will be iterated, and then select a converter that supports the current type for execution. Use canread to judge:

At this time, the problem is found. Under certain circumstances, the contenttype of the response header is read as “application/XML”. However, the real data at this time is still in JSON format. Therefore, if the converter for XML format is deleted, the iterator will look for the next executable converter, mappingjackson2httpmessageconverter. Or change the order of the two to reduce the priority of XML.

Solution:

1: Delete XML converter

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate template = new RestTemplate(httpRequestFactory());
        // Exclude xml parsing converters to avoid parsing json data as xml
        List<HttpMessageConverter<?>> collect = template.getMessageConverters().stream().filter(m -> !(m instanceof MappingJackson2XmlHttpMessageConverter)).collect(Collectors.toList());
        template.setMessageConverters(collect);
        return template;
    }

2: Reduce XML converter priority

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate template = new RestTemplate(httpRequestFactory());
        // Turn down the priority of xml parsing
        int xml = 0, json = 0;
        List<HttpMessageConverter<?>> messageConverters = template.getMessageConverters();
        for (int i = 0; i < messageConverters.size(); i++) {
            HttpMessageConverter<?> h = messageConverters.get(i);
            if (h instanceof MappingJackson2XmlHttpMessageConverter) {
                xml = i;
            } else if (h instanceof MappingJackson2HttpMessageConverter) {
                json = i;
            }
        }
        Collections.swap(template.getMessageConverters(), xml, json);

        return template;
    }

[Solved] AAPT: error: resource android:attr/lStar not found

Recently, I want to try the KTX expansion Library of Android core in the project:

implementation "androidx.core:core-ktx:1.7.0"

After adding dependency, we happily start to use various concise syntax sugars provided by KTX to fly happily~

Once running, wow, I reported an error:

Android resource linking failed /Users/xxx/.gradle/caches/transforms-2/files-
2.1/5d04bb4852dc27334fe36f129faf6500/res/values/values.xml:115:5-162:25:
 AAPT: error: resource android:attr/lStar not found.

 

Solution 1:

If the dependency method is
AndroidX.Core: core-ktx:+
you need to replace it with a specific version
AndroidX.core:core-ktx:1.6.0

Solution 2:

If the version is  1.7.0, the compilesdkversion of the project is 31, because my project is 30, an error will be reported and changed to 1.6.0 version is good

[Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“

Environmental description

Server: CentOS 7
docker: 20.10 12
kubeadm:v1. 23.1
Kubernetes:v1. twenty-three point one

Exception description

After docker and k8s related components are installed, there is a problem when executing kubedm init initializing the master node
execute the statement

kubeadm init \
--apiserver-advertise-address=Server_IP \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version=v1.23.1 \
--pod-network-cidr=10.244.0.0/16 \
--service-cidr=10.96.0.0/12 

Error reporting exception

[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.

According to the prompt following the error, you can use journalctl -XEU kubelet or journalctl -XEU kubelet -L to view the detailed error information. If you can’t see it completely, you can directly use the direction keys to adjust the error information.

This is

[root@k8s-node01 ~]# journalctl -xeu kubelet
Dec 24 20:24:13 k8s-node01 kubelet[9127]: I1224 20:24:13.456712    9127 cni.go:240] "Unable to update cni config" err="no 
Dec 24 20:24:13 k8s-node01 kubelet[9127]: I1224 20:24:13.476156    9127 docker_service.go:264] "Docker Info" dockerInfo=&{
Dec 24 20:24:13 k8s-node01 kubelet[9127]: E1224 20:24:13.476236    9127 server.go:302] "Failed to run kubelet" err="failed
Dec 24 20:24:13 k8s-node01 systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE
Dec 24 20:24:13 k8s-node01 systemd[1]: Unit kubelet.service entered failed state.
Dec 24 20:24:13 k8s-node01 systemd[1]: kubelet.service failed.

Move the direction key to the right to view the details of the fourth line

ID:ZYIL:OO24:BWLY:DTTB:TDKT:D3MZ:YGJ4:3ZOU:7DDY:YYPQ:DPWM:ERFV Containers:0 ContainersRunning:0 ContainersPaused:0 Contain
 to run Kubelet: misconfiguration: kubelet cgroup driver: \"systemd\" is different from docker cgroup driver: \"cgroupfs\"

Error reporting reason

In fact, according to the above error information, it is caused by the inconsistency between k8s and docker’s CGroup driver
k8s is SYSTEMd, while docker is cgroupfs
Yes

docker info

Check CGroup driver: SYSTEMd or cgroupfs are displayed. K8s defaults to cgroupfs

Solution:

Modify the cgroup driver of docker to systemd
edit the configuration file of docker, and create it if it does not exist

vi /etc/docker/daemon.json

Modified to

{
…
“exec-opts”: [“native.cgroupdriver=systemd”]
…
}

Then restart Dockers

systemctl restart docker 

Re kubedm init

[Solved] Error: The superclass, ‘Animal‘, has no unnamed constructor that takes no arguments.

Error: The superclass, ‘Animal’, has no unnamed constructor that takes no arguments.

Problem Description:

Because the constructor cannot inherit
an error is reported during inheritance, which prompts that the constructor in the parent class is composed of parameters. You need to write the constructor in the subclass and pass the constructor of the parent class to parameters

class Animal {
  String name;
  int age;
  Animal(this.name, this.age);

  void printInfo() {
    print('$name is $age years old');
  }
}

//Inherit Animal class by extends keyword
class Cat extends Animal {
 
}

void main(List<String> args) {
  Cat cat = new Cat();
 print( cat.name);
}

Solution:

Super keyword

Try declaring a zero argument constructor in ‘Animal’, or declaring a constructor in Cat that explicitly invokes a constructor in ‘Animal’.dart(no_default_super_constructor)

Try declaring a zero parameter constructor in “animal” or a constructor that explicitly calls the constructor in “animal” in cat.dart (no default super constructor)

class Animal {
  String name;
  int age;
  Animal(this.name, this.age);

  void printInfo() {
    print('$name is $age years old');
  }
}

//Inherit Animal class by extends keyword
class Cat extends Animal {
  Cat(String name, int age) : super(name, age);

}

void main(List<String> args) {
  Cat cat = new Cat("Huahua",3);
 print( cat.name);
}