JSP debugging problems

I am evaluating IDEA (current evaluation version), and encountered problems debugging jsp pages. My application is set up as web application, and debugging of my java files (used by this application) works OK, but breakpoints in jsp pages are totally ignored. I am using intergrated debugger and Tomcat 4.0 (not sure what build though, could not locate this info). The details of my configuration are described (in excruciacing detail, sorry) below. I will appreciate any advice. What am I missing?



Here are the details (sorry if I am too detailed)
Tomcat is installed in c:\apache_1_3\tomcat
My web application is in c:\apache_1_3\websites\myapp
myappfolder has the following structure:

The real "stuff" is in c:\apache_1_3\websites
myapp\logs\myapp\java folder:
c:\apache_1_3\websites\myapp\java\myapp (here are jsp pages)
c:\apache_1_3\websites\myapp\java\WEB_INF (here are the \lib, \classes etc folders as well as web.xml)
The lib folder contains some jar files that my app is using (third party etc), the classes folder is where my own java files are compiled into.

(this directory structure may look weird bit it is company standard).

The context for tomact is defined as /myapp, and the virtual host is defined as myapp.mycompany.com
So I call my jsp pages in the browser by (e.g) http://myapp.mycompany.com/myapp/welcome.jsp
The jsp files - as far as I can see - are being compiled into
c:\apache_1_3\tomcat\work\a8050\myapp.mycompany.com\myapp folder

Everything is configured OK as far as Tomact is concerend - the application runs fine when using Tomcat outside IDEA.

So much for my tomcat configuration. Now for Idea project.

Project Path:
c:\myprojects\myapp (this is where I keep my java files)

c:\...\IdeaProjects\myapp\src (added by Idea, empty folder) c:\myprojects\myapp c:\apache_1_3\websites\myapp classpath: ]]>
(and other jars in web-inf\lib folder)

compiler output path (single output path) is set to C:\Apache_1_3\websites\myapp\java\myapp\WEB-INF\classes
Exclude output is checked

Enable Web support is checked, and web application is defined as myapp in folder C:\Apache_1_3\websites\myapp\java\myapp
( I had to specify this folder since when I tried C:\Apache_1_3\websites\myapp\ IDEA complaned about no web-inf subdirectory)

The Debug configuration (webApp tab):

web application: myapp
application server: Tomcat 4.0.x server
debugee host: localhost
debuggee port: 5005
catalina home: c:\apache1_3\tomcat
path to catalina configs: c:\apache1_3\tomcat\conf
application context path: /myapp
VM parameters: -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

The same VM parameters are being passed to Tomcat.

When I run debug session, all jsp files work fine and I can set breakpoints in my java files and everythig seems to work OK, but when I set breakpoints in jsp files, they are being ignored and the page simply displayes in browser without entering into debug mode.

Comment actions Permalink

According to this page

You need to use integrated tomcat module. However, I have never done that. I am waiting for jsr45 (http://www.jcp.org/jsr/detail/45.jsp) to be implemented in IDEA so I can debug JSPs running our tomcat 5 server.

Here is how we debug generated .java file, which is not so bad IMHO. I used instructions from this site: http://www.bluemarsh.com/java/jswat/docs/howto-tomcat-jsp.html

Hope this helps.

P.S. Jasper2 shipped with Tomcat5 produces classes that implement jsr45. However, this seems to have a nasty side effect for IDEA. It will break inside the generated .java file. However, the line numbers will be from original JSP. So you need to give an option to tell jasper to not generate the new debugging info.

Comment actions Permalink

If you mean version 3.0.5 you cannot debug JSPs if your directory structure distincts from web application structure used in deployed application by Tomcat.
If you use 4.0 betas then you can debug JSPs in 4.0.x and 5.0.x Tomcats. Download sample project from the Wiki and adjust it to your needs.



Please sign in to leave a comment.