How to debug container managed security (tomcat)

I have a web app configured to use container managed security. The login form posts to j_security_check. I'm deploying the application via IntelliJ's Tomcat Server (local). I would like to set a breakpoint in tomcat's source code to debug some issues with container managed security. How would I do this with IntelliJ?

1 comment

Hello,

IDEA limits scope of the source code to be debugged (to look for classes with breakpoints) to the modules of artifacts being deployed with the run configuration.
If a run configuration has no artifacts to be deployed then scope of the source code to be debugged is the whole project.

So, to debug Tomcat, you need to include Tomcat sources into the project and launch a Tomcat run configuration with empty deployments list in debug mode.
Since you need to deploy an artifact (your web application), I can propose the following workflow:

1) include Tomcat sources into the project
2) create Tomcat local run configuration A -- and keep its deployments list empty
3) create Tomcat remote run configuration B -- and add your web application to its deployments list
4) launch Tomcat local run configuration A in debug mode -- it should stop on breakpoints in Tomcat sources
5) wait until Tomcat finished startup and 'Connected to server' message appears in the Output tab of the run configuration tool window
6) launch Tomcat remote run configuration B in run mode (not in debug mode)

HTH,
Regards,
Michael
0

Please sign in to leave a comment.