By billcore
1.Server environment 1.1JDK1.8 1.2Tomcat9 1.3Ubuntu 20.04.6 LTS 2 Problem screenshot 2.1.Screenshot of the API call system error log is shown in Figure 1
http://static.haou8.cn/question_1.png
Figure 1 error log of system
2.2 Erroneous program code is shown in Figure 2
http://static.haou8.cn/question_2.png
Figure 2 error of program
3 Questions 3.1 Description of problem In Figure 2, there are no issues with the program code on line 372 (checking if JSON is empty) and line 376 (executing normally if JSON is not empty), but there is an error on line 392 (JSON object is empty). Could you please tell me the reason for the error. 3.2 Cause of program exception The JSON object is released when the program executes to line 392.
3.3 Problem? Please analyze the reasons for this issue from the perspective of server operation and maintenance。
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey!
Looks like your JSON object is getting released or set to null somewhere between line 376 and 392. If that JSON is shared across threads (like a class-level or static variable), it’s possible another request or thread is overwriting or clearing it.
Also worth checking if you’re hitting memory pressure or GC is aggressively cleaning up under load, especially if the object isn’t strongly referenced.
Make sure the JSON object is scoped to the current request and not reused across threads. If it’s already request-scoped, try logging the object or its hash at different points to see where it changes.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.