Tag Archives: development language

[How to Solve] error at ::0 formal unbound in pointcut

error at ::0 formal unbound in pointcut

This error was reported when using aop’s @before for log prenotification

Error code here

	@Before(value = "webLogAspect()")
    public void logBefore(JoinPoint joinPoint,Object ret) {
        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = attributes.getRequest();
        //在attribute中加入开始时间
        request.setAttribute("time",System.currentTimeMillis());
    }

Then, after I remove the second parameter, it is normal

@Before(value = "webLogAspect()")
public void logBefore(JoinPoint joinPoint) {

Explain that other operations are required when multiple parameters are used, otherwise an error will be reported

@Before(value = "webLogAspect() && args(ret)")
public void logBefore(JoinPoint joinPoint, Object ret) {

Problem-solving

[Solved] Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:

Running error

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.scheduling.quartz.SchedulerAccessor.registerListeners(SchedulerAccessor.java:351)

The following method did not exist:

    org.quartz.Scheduler.getListenerManager()Lorg/quartz/ListenerManager;

The method's class, org.quartz.Scheduler, is available from the following locations:

    jar:file:/D:/repository/org/opensymphony/quartz/quartz/1.6.1/quartz-1.6.1.jar!/org/quartz/Scheduler.class

It was loaded from the following location:

    file:/D:/repository/org/opensymphony/quartz/quartz/1.6.1/quartz-1.6.1.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.quartz.Scheduler

Analysis: it worked well before, but suddenly it didn’t work. Reading the report incorrectly may be caused by the jar package conflict of the scheduled task

1. A global check reveals that shiro-all has introduced this jar package

Solution:

When querying the dependency, I found that it is an optional part of shiro, so I exclude it directly.

<dependency>
    <groupId>org.apache.shiro</groupId>
    <artifactId>shiro-all</artifactId>
    <version>1.4.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-quartz</artifactId>
        </exclusion>
    </exclusions>
</dependency>

If the shiro-all package is introduced in a jar package, the following code can be placed under the parent package introduced by the project

     <exclusions>
        <exclusion>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-quartz</artifactId>
        </exclusion>
    </exclusions>

 

[Solved] Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerEx

Description:

When using springboot to integrate swagger2config, an error is reported. The error information is as follows:

Analysis:

I am using Springboot 2.6.3, Spring Boot 2.6.X uses PathPatternMatcher to match paths, the path matching used by Springfox referenced by Swagger is based on AntPathMatcher, so it needs to be configured.

Solution:

Add the following configuration to the YML configuration file:

spring:
  mvc:
    pathmatch:
      matching-strategy: ANT_PATH_MATCHER

[Solved] rocketmq Startup Error: Error: Could not create the Java Virtual Machine.

Java HotSpot ™ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated

It may be a JDK version problem

jdk1.8 is OK
if you want to use a higher version, such as jdk11

Windows:
Modify bin\runserver.cmd
Linux:
Modify bin\runserver.sh
before modification:

set "JAVA_OPT=%JAVA_OPT% -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:-UseParNewGC"

After modification:

set "JAVA_OPT=%JAVA_OPT%  -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8"

[Solved] Error:java: Compilation failed: internal java compiler error

1, view the project’s jdk (Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings ->Project

2. view the jdk of the project (Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings -> Modules -> (the name of the project needs to be modified) -> Sources ->

3. View Java configuration in idea
File ->Setting ->Build,Execution,Deployment -> Compiler -> Java Compiler

If the above three steps still fail
Clear IDEA cache Restart IDEA
File->Invalidate Caches/Restart

[Solved] appium Error: Original error: socket hang up

App automation error reporting and appium error reporting:

Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command.original error: Could not proxy command to the remote server.original error: socket hang up

Solution:
uninstall appium setting and other appium installed apps on the device, uninstall the automatically started app (operation object APK), and restart the device

[Solved] Golang Error: fatal error: concurrent map writes

The specific codes are as follows:

package main

import (
	"fmt"
	"time"
)

var m = make(map[int]int, 10)

func solution(n int){
	res := 1
	for i:=1; i<=n; i++{
		res = res * i
	}
	m[n] = res
}

func main(){
	for i:=1; i<=200; i++{
		go solution(i)
	}
	time.Sleep(time.Second*10)
	for ind, val := range m{
		fmt.Printf("[%d] = %d \n", ind, val)
	}
}

The following error occurred:

fatal error: concurrent map writes
fatal error: concurrent map writes




runtime.mapassign_fast64(0x10b7760, 0xc00001e1b0, 0x12, 0x0)
        /usr/local/go/src/runtime/map_fast64.go:176 +0x325 fp=0xc000106fa0 sp=0xc000106f60 pc=0x1010bc5
main.solution(0x12)
        /Users/lcq/go/src/go_base/gochanneldemo/channeldemo.go:15 +0x65 fp=0xc000106fd8 sp=0xc000106fa0 pc=0x10a88a5
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000106fe0 sp=0xc000106fd8 pc=0x1062c41
created by main.main
        /Users/lcq/go/src/go_base/gochanneldemo/channeldemo.go:20 +0x58

The main reason is because map is not thread-safe, so it is not safe to use map in case of concurrency.
Solution.

    1. Add a lock
    2. Use sync.map
    3. Use a channel (multiple threads operating a channel is thread-safe)

C++ clang Compile Error: error: expected unqualified-id

Problem overview

Today, when learning the vector container, I found that clion threw such an error, as shown in the following figure

this problem still exists after compiling with clang

~/Documents/Clion_Project/Learning/L11.cpp:12:1: error: expected unqualified-id
for (int i = 0; i < v.size(); i++)
^
1 error generated.

reason:

The main function is not written

Solution:

#include <vector>
using namespace std;

int main()
{
    struct Vertex
    {
        int a;
        float b;
    };

    vector<Vertex> v;
    for (int i = 0; i < v.size(); i++)
    {

    }
}

[Solved] QT Error: error: undefined reference to `GameModel::~GameModel()’

When compiling Qt program, error: undefined reference to `GameModel::~GameModel()’ is reported.
This is because Qt does not automatically generate the class destructor, so we need to write it ourselves, even if it is an empty function. After we write GameModel::~GameModel() by hand, the problem disappears when we compile it again.

There are two ways to write destructors:
Method 1:
in .cpp file:

Method 2:
in .h file.
in Destructor of

[Solved] command “python setup.py egg_info“ failed with error code 1

 

preface

when setting up the python 3 environment on your own server, the PIP version is too low, the upgrade pip is still invalid and falls into a dead circle. After reading many blogs on the Internet, there is no solution


1. Solution

# Download get-pip.py
wget https://bootstrap.pypa.io/2.7/get-pip.py
python get-pip.py

[Solved] MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe“

MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”.

This problem occurs in the install front-end project

MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”…

Solution:

1. The administrator opens CMD and sets the agent (optional, if you have one)

set HTTP_PROXY=http://127.0.0.1:1080
set HTTPS_PROXY=http://127.0.0.1:1080

2. Install windows build tool

npm install -g --production windows-build-tools

3. If the card is completely stuck, wait for one minute, and then enter C:\Users\Username\.windows-build-tools

If there is a file in the figure below, the download is successful, and if there is no file, the download fails

If the download fails, download it manually and extract it to C:\Users\Username\

The final status is shown in the figure:

5 Configure system environment variables (Setting -> advanced system settings -> environment variables)

Append to path item

​ C:\Users\13261.windows-build-tools

​ C:\Users\13261.windows-build-tools\python27

6. change the file name

Because the problem I encountered was MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”…

The project will use the executable file VCBuild.exe to build

So I made a copy of vs_BuildTools.exe and modified it to VCBuild.exe, so that cmd can use “VCBuild”!

Because I have already installed python3 or higher, the command is also “python”

so python2.7 I will also modify the executable to python.exe -> python2.exe, pythonw.exe -> python2w.exe

TIP: If your front-end project will be built with commands like “python2” or “python3” instead of “python” to execute python code, then you also need to rename the executable

Translated with www.DeepL.com/Translator (free version)