Category Archives: Error

Tk.mapper Common mapper Error: Error creating bean with name ‘commonMapper‘ defined in file xxx

Error message:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-07 17:26:23.763 ERROR 14960 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonMapper' defined in file [xxx\dao\CommonMapper.class]: 
Invocation of init method failed; nested exception is tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:740)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265)
	at com.blog.web.WebApplication.main(WebApplication.java:20)

Reason:
@mapperscan the scanned package cannot contain the package where the general mapper is located

Move the general mapper to other packages, then scan other Daos, @mapperscan (basepackages = "com.Blog.* *.Dao"), and start the project without reporting an error.

[Solved] Fatal message conversion error; message rejected; it will be dropped or routed to a dead letter exchan

When rabbitmq is used, the message deserialization fails, with the following exception:
fatal message conversion error; message rejected; It will be dropped or routed to a dead letter exchange, if so configured

after location analysis, the reason is that the serialization conversion jackson2jsonmessageconverter is set on the production side of MQ messages, and the default serialization class is simplemessageconverter. And the deserialization conversion is not set on the consumer side.

Solution:
because the message is a JSON string, use string to receive parameters, and then use JSON tool class to convert it into an object;

import com.alibaba.nacos.client.utils.JSONUtils;
import com.atguigu.rabbit.common.constant.MqConst;
import com.atguigu.yygh.sms.service.SMSService;
import com.atguigu.yygh.vo.sms.SmsVo;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class SmsReceiver {

    @Autowired
    private SMSService smsService;

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = MqConst.QUEUE_SMS, durable = "true"),
            exchange = @Exchange(value = MqConst.EXCHANGE_DIRECT_SMS),
            key = {MqConst.ROUTING_SMS}
    ))
    public void send(
            String json,//Receive the transmitted content
            Message message, Channel channel) {
        SmsVo smsVo = null;
        try {
            //Convert the json string into the corresponding object
            //JSONUtils pack name(com.alibaba.nacos.client.utils.JSONUtils)
            smsVo = (SmsVo) JSONUtils.deserializeObject(json, SmsVo.class);
            System.out.println(smsVo);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’

ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
removing ‘/usr/local/lib/R/site-library/httr’

apt-get install openssl
apt-get install openssl-devel

apt-get install libcurl

Or:

wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz

tar -xvf  openssl-1.1.1i.tar.gz

cd openssl-1.1.1i/

./config 

make && make install

./config shared 

make clean

make  && make install

‘curl’:

wget  http://curl.haxx.se/download/curl-7.38.0.tar.gz

tar -xzvf curl-7.38.0.tar.gz

cd curl-7.38.0

./configure

make

make install

IAR Compile Error: Error[Li005]: no definition for [How to Solve]

after transplanting the program today, there was an error report of “error [li005]: no definition for” during compilation, which was encountered and solved before. Today, I’m going to officially record the causes and solutions of this error.

1. Reasons

just look at the error reminder given by IAR, “error [li005]: no definition for xxxxx”, which means that xxxxx is not defined (all cases I encounter refer to a function), but find the problem yourself, and you will find that this xxxxx has been defined in other C files, and this xxxxx function has been declared in the header file corresponding to this C file, And the path of the header file has been included in the IAR settings. There should be no problem! Then I began to wonder.

2. Solutions

let’s talk about the solution to this problem:

2.1 the C file where the xxxxx function is located is not added in the project

most of this happens because you accidentally removed the C file from the project, and you haven’t noticed it. The solution is very simple. Add the C file to the project again and recompile it.

2.2 when using conditional compilation, the xxxxx function is not compiled

this is why I have this problem this time. Let me give you an example:

#define FANJIE 1

#if FANJIE
void Get_Fans(void)
{
    for(int i  = 0; i<100;i++);
}
#endif

Take the simple function above as an example, when FANJIE is 1, call Get_Fans() in other c files, and no error will be reported, but when FANJIE is 0, call Get_Fans() in other c files Function, it will report the error “Error[Li005]: no definition for Get_Fans”.
The solution is also very simple, just make sure that the conditional compilation can be compiled normally.

Dev C++ Error: error: ld returned 1 exit status [How to Solve]

There are several reasons for this error: error: ld returned 1 exit status

 

Solution (Four Methods to Solve, Not All):

1.undefined reference to `__gxx_personality_v0

Or compile with g++

To compile with gcc, add -lstdc++ to the edit option linker command

2. Close the program connected to the running dev

3. Definition error

4. Compile other settings issues

[Solved] Redis executes the monitor command error: noauth authentication required

After redis is connected, a (error) noauth authentication required. error is returned after executing the monitor command

[root@m214 src]# ./redis-cli -p 6412
127.0.0.1:6412> monitor
(error) NOAUTH Authentication required.

The reason is that you did not log in with password authentication

Solution:
view the redis configuration file to see the corresponding pass.

# Generated by CONFIG REWRITE
masterauth "2651080c6814a4a9d62da69a12f962b6"
requirepass "2651080c6814a4a9d62da69a12f962b6"

Then, after logging in with redis cli, execute the command auth + password, and then execute the monitor command

[root@m214 src]# ./redis-cli -p 6412
127.0.0.1:6412> auth 2651080c6814a4a9d62da69a12f962b6
OK
127.0.0.1:6412> monitor
OK

How to Solve Error: spawn xxxx ENOENT

Error explanation:   This error indicates that no such directory exists, which generally means that the global variable of command XXX is not set
The full name of enoent is error no entry, and there is no error in the entity directory;

Example: scaffold occurs when NPM installation directory is used, and spawn git enoent error occurs

Solution: it means that Git is not installed or the GIT environment variable is not set. Add “C:\program files\git\bin” in the path of the environment variable. The path is adjusted according to your git installation directory

[Solved] Error d8021: invalid numeric parameter “/wno CPP” cython_bbox

Windows system, compiling Python_ Bbox, compile parameters:

from setuptools import setup, find_packages, Extension

import numpy as np

ext_modules = [
    Extension(
        "cython_bbox",
        ["utils/cython_bbox.pyx"],
        extra_compile_args=["-Wno-cpp", "-Wno-unused-function"],
        include_dirs=[np.get_include()],
    )
]

report errors:

Error d8021: invalid numeric parameter “/wno CPP”

Error d8021: invalid numeric parameter “/wno unused function”

Solution:

from setuptools import setup, find_packages, Extension

import numpy as np


ext_modules = [
    Extension(
        "cython_bbox",
        ["utils/cython_bbox.pyx"],
        extra_compile_args=["-std=c++14"],
        include_dirs=[np.get_include()],
    )
]

Or:

        extra_compile_args=["-std=c99"],

Then compile OK:

QT error: – LGL not found [How to Solve]

QT error: – LGL not found

This is because QT cannot find the OpenGL dynamic link library (LIBGL.So). OpenGL is installed by default in most Linux distributions, including Ubuntu, CentOS, etc. if the link library cannot be found, the path is generally wrong.

Solution
1. Use root to find the path of “LIBGL.So” file. Use find/usr - name "LIBGL *" to find
2. The search result is that the version number is added to the suffix of the OpenGL link library provided with the Linux distribution, such as LIBGL.So.1.2.0, LIBGL.So.1.3.1, etc., but the OpenGL link library found by QT in the link phase does not have the version number. So we need to create a link for the OpenGL link library in the/usr/lib/directory and remove the version number
3. Just create a soft connection with ln - s

error MSB8011: Failed to register output [How to Solve]

error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

Cause of formation: in versions above win7, only administrator privileges can run regsvr32.exe program, that is, only administrator privileges can register controls or DLLs.

Solution:

1. When running vs, right-click to run with administrator privileges. Do not open vs directly.

2. Engineering – > Propertier–> Linker–> General–> Register Output–> NO。

git error:invalid path [How to Solve]

Pull handover branch code and error found git error: invalid path xxx or error: unable to create file

    1. git status Look at the code that needs to be processed
    2. git reset –hard To a previous stable version
    3. git clean -df Clear uncommitted files

The file that caused the error was found in the git history

  1. error: unable to create file keycloak-10.0.2/F:\workspace\electric\sedt-webfront\keycloak-10.0.2\standalone\log\server.log: Invalid argument
  2. Who submits the file and who deletes the file
  3. git pull Re-pull the file

Reason: There is a difference between the file path created by Mac and Windows, which causes the file path created cannot be generated in Windows. Delete the file to solve the problem