Debugging my web application in Local Tomcat configuration.

Hi,

I am trying to figure out how to debug my webapp using intelij and tomcat.

Till now I have been doing it with eclipse with tomcat plugin.
#1. I have context files in Conf->Catalina->localhost.
#2. I build the application from cmd prompt using : "mvn clean install". For each project, there is a target forder where the jar is created and there is a folder with the jars contents(I presume the exploded war).
#3. I use the plugin to start tomcat.
#4. Put breakpoint and debug.

For intelliJ, I want to setup the local tomcat configuration.

On the Local Tomcat Startup/Connection tab, the JAVA_OPTS  command has parameter "server=n", I understand that it will be looking to connect to a tomcat server running in debug mode at the specified port.
Q. Does this mean that I have to start tomcat externally(outside intelliJ)?

NOTE: Using Remote Tomcat configuration, I am able to debug my application.

-Thanks and Regards.

1 comment

saundab wrote:


Q. Does this mean that I have to start tomcat externally(outside intelliJ)?

It does not. You can start tomcat within IntelliJ IDEA (i.e. using a Local run/debug configuration) and debug your code. Read through the thread at http://devnet.jetbrains.com/message/5466173#5466173 In it I provided another user some detailed instructions on how to configure a maven built project to run in Tomcat locally for debugging. (Please be sure to read all the way through as there are two man response posts.)

You can also take a look at the tutorial: http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_and_deploying_it_to_Tomcat

If you still have questions or problems, let us know and we can help.

0

Please sign in to leave a comment.