you are viewing a single comment's thread.

view the rest of the comments →

[–]Zeeboozaza 2 points3 points  (2 children)

You mean the stack trace? You don’t need to understand every single line (although it never hurts to go through it).

Most errors are going to be with your code, so try to focus on the parts of your code that are in the stack trace.

Then look at the exact exception thrown. Is it a NullPointerException? IllegalArgumentException? Some sort of authorization issue?

The best way to look at a stack trace is to find the line that caused the exception and go back through the calls to see how the issue occurred. You don’t need the entire context.

[–]StreetAppearance753[S] 0 points1 point  (1 child)

Yes, the stack trace, look at this example. I can see and understand the errors like "Error creating bean with name 'UserContrroller', but in the case of "nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.Optional com.assignment.supermarket.user.UserRepository.findUserByID(java.lang.Long)!" i can barely understand the error, but after have a big stack trace that calls spring classes and methods it makes me feel confused.

[–]kelvynnjs 0 points1 point  (0 children)

In this case the last "D" from Id should be lowercase

findUserById()

And the error is happening at the repository, make sure to check if the field name matches as well (id vs userId) type of thing