I have some J2EE application, and I’m able to see the what that application is doing in it’s web interface. I also have the source code for the application. I want to realize what code is actually executed, when I click something in the web interface.
What is the best method to find out this? I was thinking of putting the breakpoint on the first line of each method, but it is quite annoying to do it manually :-), so I hope that is some better method.
Thanks for answering.
Your application is deployed on an application server. You can debug it by starting the server in debugging mode. JBoss for example has a nice tool suite for eclipse. With the tools, debugging is just a press of a button away (the one with the bug).
Logging is definitely an option too, though you will not get as much detail. Personally I prefer logback over commons for a number of reasons.
If you have no clue, where to set your breakpoints/ where to log, and the package structure is not helpful, you could start with methods in your EJBs. Look for annotations like
@Stateless,@EJB(to find injection points and go from there) for example.If there are servlet classes, start there, or if it is a JSF frontend, look for
@ManagedBeanannotations.