Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Java reporting error

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains how to solve the problem of reporting errors in Java. The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to solve the problem of reporting errors in Java.

1. Operator priority is not clear, should be parenthesized without parentheses-the solution (write a short paragraph to debug, and use the breakpoint function to find out the problem. )

two。 It is best to make some conditional judgments to prevent null pointer exceptions.

3. The related toolkit was not imported. (manual import)

4. Pay attention to the scope of the variable (put it on the outside), statement block 1 cannot get the variable value of statement block 2

5. No parameters are passed

6. {} is in the wrong position.

7.

Public static void main (String [] args)

Note the difference between the two, which causes the entire class to fail to run

Public void main (String [] args)

8. The code is misplaced and written outside the main method

9. The package name is misspelled, for example, it was originally mapper.xml, but it was written as maper.xml.

10. There may be something wrong with the top guide package (don't get it wrong), and start the whole body (the corresponding configuration file is also likely to be modified)

11. It is best to refresh frequently in maven (with buffered ba)

twelve。 The reason why there is no guide package is that the pom file is not configured.

13. Put a breakpoint before the return value to find the location of the bug

14. Remember to write parameters.

15. Note the location of the Application startup class

16. Identify the problem by setting the journal level (info/debug) in the Application class

17. Incorrect name of database table field

18. The related services have not been started yet.

19. The relevant comments (@ Controlller) are not written in the controller class

Thank you for your reading, the above is the content of "how to solve the problem of Java error". After the study of this article, I believe you have a deeper understanding of how to solve the problem of Java error, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report