Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Debugging

Tips for analysis and debugging regarding stack traces.

The First 20-40 Lines

This is usually enough to see the actual error and the immediate call chain.

Always Include the First Exception Line

For example:

  • NullPointerException
  • BeanCreationException
  • SQLException

Find the First Line That Points to Your Own Code

For example:

at com.myapp.service.UserService...

This is often more useful than dozens of Spring framework lines.

Always Include the "Caused By:" Sections

In Spring Boot, the real root cause is often 1-3 exceptions deeper.

If There Are Multiple "Caused By:" Sections

Copy around 50-100 lines, but do not automatically copy the entire stack trace if it is several hundred lines long.

Rule of Thumb

Beginning of the exception
+ all "Caused by:" sections
+ the first lines pointing to your own code

= about 30-60 lines

This is usually ideal for analysis and debugging.

About

Debugging tips

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages