Problem debugging JSP in Tomcat 6.0.16

I need help figuring out why I am unable to debug JSPs using Tomcat 6.0.16 and IDEA 7.0.3 on Vista. I am able to put in breakpoints in the JSPs (red circle without an “x”) but the breakpoints are ignored. Breakpoints work fine in the regular Java classes. My webapp is not a standard configuration, and that may be related. The Context docBase is not a subdirectory of the Host appBase. In fact, the Host appBase points to an empty directory.

Is there a description somewhere of how IDEA takes the server.xml and context.xml files in $ and $ and reprocesses them?

It seems that IDEA creates a private base directory and creates a modified server.xml and a Catalina/localhost/ROOT.xml in it. The name of the private base directory is something like C:\Users\MyName\.IntelliJIdea70\system\tomcat_test_G4-Project2eec5e16.

IDEA then sets the CATALINA_BASE environment variable to the name of the private base directory and executes the startup command specified in its Tomcat 6 Application Server configuration.

8 comments
Comment actions Permalink

I need help figuring out why I am unable to debug JSPs using Tomcat 6.0.16 and IDEA 7.0.3 on Vista. I am able to put in breakpoints in the JSPs (red circle without an “x”) but the breakpoints are ignored. Breakpoints work fine in the regular Java classes. My webapp is not a standard configuration, and that may be related. The Context docBase is not a subdirectory of the Host appBase. In fact, the Host appBase points to an empty directory.


Please attach your project files (iml, ipr, iws).

Is there a description somewhere of how IDEA takes the server.xml and context.xml files in $ and $ and reprocesses them?

It seems that IDEA creates a private base directory and creates a modified server.xml and a Catalina/localhost/ROOT.xml in it. The name of the private base directory is something like C:\Users\MyName\.IntelliJIdea70\system\tomcat_test_G4-Project2eec5e16.

IDEA then sets the CATALINA_BASE environment variable to the name of the private base directory and executes the startup command specified in its Tomcat 6 Application Server configuration.


Yes, IDEA actually perform all these steps when you run local Tomcat configuration.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

I've attached a ZIP file that contains the project and module files.

I've also included my ${catalina.base} directory so you can see the server.xml that I use. My ${catalina.home} directory has the unchanged distribution of apache-tomcat.-6.0.16.

I've also included the temporary Catalina base directory created by IDEA.



Attachment(s):
Tomcat6 JSP Problem.zip
0
Comment actions Permalink

I have been using IntelliJ since 4.x and I have never gotten JSP debugging to work with Weblogic. The breakpoints are simply ignored. I experience the same behavior with remote and local instances of Weblogic. I finally came to the conclusion that JSP debugging simply doesn't work.

Is JSP debugging supposed to work?

0
Comment actions Permalink

Michael,

I've been able to get JSP breakpoints to work with Tomcat 6.0.16 in other situations, but not with the configuration that I need to use (for legacy reasons). That configuration is described in my original post.

I can get JSP breakpoints to work if I create a conventional web application whose directory is a child of the directory specified by the appBase (the webapps directory) and if have IDEA deploy the web.xml, libs and class files into its WEB_INF subdirectory.

My "problem" is that I have a web application directory that is fully formed but lives outside the webapps directory in a directory with many other files and directories in it. The docBase is an absolute path reference. There may be an additional factor related to the failure of JSP breakpoints - there is nothing for IDEA to deploy. All the files that need to be in my webapp directory are there already. This may be a problem for IDEA which seems to have a need to "deploy" the application. The Tomcat Application will not allow the debugging to start unless it has a Facet to deploy.

0
Comment actions Permalink

Paul Albrecht wrote:

Michael,

I've been able to get JSP breakpoints to work with Tomcat 6.0.16 in other situations, but not with the configuration that I need to use (for legacy reasons). That configuration is described in my original post.

I can get JSP breakpoints to work if I create a conventional web application whose directory is a child of the directory specified by the appBase (the webapps directory) and if have IDEA deploy the web.xml, libs and class files into its WEB_INF subdirectory.

My "problem" is that I have a web application directory that is fully formed but lives outside the webapps directory in a directory with many other files and directories in it. The docBase is an absolute path reference. There may be an additional factor related to the failure of JSP breakpoints - there is nothing for IDEA to deploy. All the files that need to be in my webapp directory are there already. This may be a problem for IDEA which seems to have a need to "deploy" the application. The Tomcat Application will not allow the debugging to start unless it has a Facet to deploy.


Please attach your project files (ipr, iml and iws).

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

I did attach them in the post of Posted: Jul 10, 2008 5:20 PM (see above)

0
Comment actions Permalink

Web roots aren't specified for G4 Web facet. Try to add MODULE_DIR/site as a Web Resource directory (G4 Web Facet settings, "Web Settings" tab).

I did attach them in the post of Posted: Jul 10, 2008 5:20 PM (see above)



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Thanks. That did the trick. Now I have a project where I can have IDEA accept my web application and do JSP debugging. The web application directory is outside of Tomcat’s webapps folder. IDEA does not have to move any files as part of the deployment (except the jar files into WEB-INF/lib, which need to be mastered from elsewhere, for legacy reasons).

Just to summarize for anyone else who struggles with this in the future:

1. I have a directory $ which I want to run as a webapp under Tomcat 6. The webapp maps to the root (“/”). My value of $ is C:/Work/IPV/IPV/site.

2. I’ve attached two PNG files that show how the facet is being set up.

3. I have the compiler output directory $/WEB-INF/classes 4. I have only copy of web.xml is at $/WEB-INF/web.xml. The default web.xml in ${catalina.base} is still being used as the default XML by Tomcat.

5. My server.xml in ${catalina.base} has the customized as: ]]>

6. I have created a library with the Tomcat 6 JAR and SRC files and included that library in the module. This allows me to step into Tomcat 6 and debug, which is especially useful in debugging some of the configuration issues.

Edited by: Paul Albrecht on Jul 16, 2008 10:36 PM



Attachment(s):
IDEA-Tomcat 6 - Web Facet Settings.zip
0

Please sign in to leave a comment.