Tag Archives: problem

[Solved] defineClass Error: java.lang.NoClassDefFoundError: Illegal:

The defineclass() method actually converts byte bytes into class objects

I always thought that the problem in the above picture was that the path could not be found, so I kept changing various paths. As a result, it was wrong to try. As a result, I looked at a blog and directly passed the empty parameters. I took a try attitude. I found that it was right and did not report an error. Suddenly, I found that alas, how can it be empty, Click the converted class to see the data, and then assign the value to the parameter according to that

Just change the ASM/asmhelloworld parameter to asm.asmhelloworld.

Done!

How to Solve Error: failed to load response

reason:

Because the back-end does not write cross-domain-related information to the header, the front-end cannot load data.

analysis:

1. First, check whether there are cross-domain-related configurations in the project, and then find out whether there are configurations.

2. This should be added only when the controller is executed.

3. Because our project has built an interceptor to intercept the token parsing into user-related information, because if there is no token expiration, the interceptor will throw an exception. When returning, cross-domain-related things will not be added. So the front end cannot be loaded.

Solution:

Add response and related cross domain information to the interceptor

In addition, you need to know the execution sequence of interceptors and filters

* ** ->  Filter -> Interceptor -> ControllerAdvice -> Aspect -> Controller

Some error occurred error: listen eaddinuse: address already in use 127.0.0.1:3000

In this case, the port is occupied
solution:
window + R open run input CMD open DOS command window

Input: netstat - ano view port

the red mark indicates that the port is occupied,

Enter the TCP number corresponding to taskkill/F/T/im in CMD to turn off the occupied port
and then NPM run serve can be run normally

[Solved] Parsing JSON error unexpected end of JSON input

It’s normal to jump and pass parameters using JSON, but today I don’t know why I reported an error, unexpected end of JSON input,
reason
I found the answer on the Internet because there are unrecognized contents in the passed parameters, and the parameters I passed contain rich text, Therefore, there is no resolution
solution
start with JSON character parameters (parent page) on the page to jump to

issueanswer(item){
				let arrar = JSON.stringify(item)
				uni.navigateTo({
					url:"issueanswer?arr="+encodeURIComponent(arrar)
				})
			},

Then accept and parse the parameters in onload of the sub page

onLoad(option) {
			this.arr =JSON.parse(decodeURIComponent(option.arr))
		},

[Solved] Git push Error: remote: Support for password authentication was removed on August 13, 2021.

An error was reported when pushing the code to GitHub today:

the reason is that GitHub does not support the password authentication scheme, so use personal access token instead.

Solution

Generate token on GitHub

Settings -> Developer Settings -> Personal Access Token -> Generate New Token -> Check – > Click generate token – > Copy the generated token

Change the local certificate to personal access token

Control panel – > Credential manager – > Windows credentials – > Locate git: https://github.com , just change the credentials to the previously generated token.

For other platforms, please refer to support for password authentication was removed. Please use a personal access token instead [duplicate]

CONDITIONS EVALUATION REPORT

CONDITIONS EVALUATION REPORT

Spring boot project display: conditions evaluation report

Reason: the log is configured with the level property

terms of settlement:

In the configuration file application.yml or application.properties, add:

logging.level.org.springframework.boot.autoconfigure: error

Why interview requires reading the source code

Some people always think that when interviewing to build an aircraft carrier, you need to screw up your work. In the junior interview, you often ask, what is the life cycle of spring and what has been done since it was started, but it doesn’t matter at work. It’s useless and meaningless. Is that really the case?

Here is a small problem that can only be solved by understanding the initial sequence of spring.

Problem description

In the old version, obtaining a certain data XXX depends on a table tb in the database_ XXX, the new version requires to obtain these data by calling service_ B service interface. It’s reasonable to change bservice’s implementation class to interface mode, but after the change, we find that the application can’t be started! Error: DH handshake failed! I didn’t modify other logic, but I couldn’t start it, and the interface I called doesn’t need any encryption verification. As a fresh undergraduate who has been employed for less than two months, how can I solve this situation?

Background

Application introduction
our Java Web application service_ A is dynamic, the page is dynamic, the fields of the entity class are dynamic, the functions of an entity class and the services to be accessed are dynamic. You need to read the XML configuration file at startup to determine what the application looks like and what capabilities it has. The technology stack is SSM. In order to facilitate the natural loading of XML in @ postcut, That is, these XML configuration files are loaded after bean creation.

Requirements and changes
in the new version of the technology stack, we need to switch to spring boot, with some functional changes. Parsing these model configuration files actually depends on a table tb in the database_ XXX, the new version requires to obtain these data by calling service_ B service interface.

Introduction to service invocation
before calling other services remotely, you need to call addressing service first_ X address to obtain the protocol, IP, port and domain information of the target service, and then get the same address as the domain of its own service, and then get a callable instance of the target service according to the specified load balancing algorithm to call. The sensitive interface needs DH handshake and data encryption and decryption.


Problem orientation

I just changed a service method from database to interface, and the error was DH handshake failure. There was no change, which means that there must be something wrong with the interface call. Debugging found that the DH error occurred in the service addressing report, that is, the error occurred before entering the code I wrote, and the service addressing code was provided by the internal framework, Other people are also using the frame. Why didn’t other people respond?

Make a breakpoint in the addressing part of the framework code of idea decompilation, and debug step by step to find that the addressing service is being called_ The IP port of the target host can’t be found in X, but the framework code takes it directly from the cache. If it doesn’t, NPE will be thrown, and it will be thrown as a DH error by the upper layer. It is reasonable to say that there should be IP port information of addressing service in cache. Debug check shows that the cache is empty, size = 0, indicating that it has not been put in. Ctrl Alt F7 looks for a wave to see where the key pair will be put into the cache. It is found that the framework injects a bean: serviceinfolistener, which is executed after listening to the applicationcontextinitializedevent.

At this point, students who have read the spring source code or know what spring did when it started will immediately know what the problem is, because XML parsing is too early, and the dependent service addressing is not initialized at this time, so it cannot be called.


solve

Temporary scheme:
the parsing of XML will be delayed until the listener of the framework is finished.

The following scheme:
discuss with the framework group, the framework will rely on the addressing service_ The configuration time of X’s secret key pair is advanced to the after properties set of initializing bean, that is, the application developed with the framework is allowed to be called remotely at startup.