0

I've been debugging in the spring boot framework. I need your debugging advice.

I am getting an error during app creation. So not able to put breakpoints.

And I found out this exception is actually thrown in the dependency class which is not editable.. -> which also means I can't add more loggers...

fortunately, I was able to find out what method throws the exception. but I am really not sure why. I want to print out the actual value in the console and see what value is being set and what went wrong and also want to know then what value should I change it too..... If it was just inside my codebase and the app was running, I think it could be easier. but now I am so lost...

Please share your debugging strategy. And also is it wrong to look for alternate solutions if there's a blocker or I am stuck on something?

Sujith Kumar
  • 872
  • 6
  • 19
lusjjj
  • 1
  • You should be able to add breakpoints on lines of code that come from dependencies, even dependencies you did not write. At least if you have access to the source code of the dependency (and you're creating a Spring Boot application, which means you're probably using Maven or Gradle as a build tool, and most well-known open-source projects publish their sources to Maven Central, so you _should_ have access to the dependency's source code pretty much automatically). – Slaw Mar 24 '23 at 03:53
  • You can set breakpoints during app creation. Just use `suspend=y`. See https://stackoverflow.com/questions/138511/what-are-java-command-line-options-to-set-to-allow-jvm-to-be-remotely-debugged – tgdavies Mar 24 '23 at 04:39

0 Answers0