Eclipse stack trace

How to trace a stack through eclipse? In my code, I try to upload a file, when I perform an action to upload files in an application, it just freezes without error messages. I tried to debug, but that didn't help much.

+3
source share
3 answers

Assuming you are running an application from Eclipse, but inside a Java EE container such as Glassfish or Tomcat, calling the printStackTrace () method of the exception object (when caught) displays the stack trace in the console window in Eclipse. In your case, you first need to know if an exception is raised at all. I would not recommend creating an Exception object at runtime to pop a stack out of it.

, , , , log4j, jul slf4j, .

, ( ), .

+2
  • "jvisualvm" bin JDK , Glassfish.
  • Glassfish, "Local".
  • "" " ".
  • .
  • Eclipse Java Stack .
+2

I would recommend going through the eclipse debugger to find out where it hangs. This will automatically give you a stack trace as you pass.

I find that the step-in function (F5) is most useful, it allows you to go down to functions recursively to examine what is going on.

You can set breakpoints at the beginning of the file upload code so you can get started at about the right place. In my version of Eclipse, the stack trace appears in the upper left panel of the Debug under the corresponding thread.

+1
source

Source: https://habr.com/ru/post/1753336/


All Articles