Stian,
I have only one project in Eclipse, which contains only one JSP file
(and no classes, etc.). The project is checked in both of the places
you mentioned.
I've tried this with all combinations of Eclipse 2.1.2, 2.1.3, and JDK
1.4.2, 1.3.1, and Sysdeo Tomcat Plugin 2.2 and 2.2.1.
If I follow everything in the instructions to the letter, create a
launch config, start Tomcat with the Debug Config "Tomcat 4.0.x",
launch my JSP, refresh the work folder so I can see the .java file,
set a break point, and then rerun the JSP, I get a popup dialog box
asking where the source is for the class. If I leave "Use default"
checked, I get an editor window displayed for "_jspService" which
contains in red text: "Source not found for
test$jsp._jspService(HttpServletRequest, HttpServletResponse) line: 54
I can see that the break point was reached and the thread stopped at
line 54 where I set the breakpoint in the .java file, but the debugger
can't seem to locate the file.
If I launch Tomcat using the normal run button, I something a little
different -- I get an editor window displayed for "test$jsp.class"
which contains the text:
Class File Editor
Source not found
There is no source file attached to the class file test$jsp.class
Again, I see in the threads that the break point was reached and
stopped properly at the break point I set on line 54 of the .java
file.
Also, I'm using Tomcat 4.0.6 -- should this be a problem?
-Craig
Craig - 04 May 2004 20:17 GMT
Aha - some progress...
I read in a posting in an eclipse.org newsgroup that someone else had
this problem, and upgrading to Tomcat 4.1.x fixed it.
And it fixed it for me too.
The Sysdeo plug-in has a problem debugging JSPs under Tomcat 4.0.x (at
least 4.0.6).
I wonder if this has to do with the fact that the compiled .class and
.java file under 4.0.x has a "$" in the name (e.g. test$jsp.java),
whereas 4.1.x has "_" (e.g. test_jsp.java).
Unfortunately, we really need to use 4.0.6 since we're using a third
party tool which only supports 4.0.6.
Help!!
-Craig
Sebastian Millies - 06 May 2004 11:35 GMT
Maybe it's possible to use a later version of jasper with
Tomcat 4.0.6 and precompile your JSPs. Or precompile
them with the precompiler of Tomcat 4.0.6 and then rename
them. (Tomcat doesn't care what the classes are called, AFAIK)
The precompiling could be done in an Ant task.
-- Sebastian
> Aha - some progress...
>
[quoted text clipped - 16 lines]
>
> -Craig
Craig - 20 May 2004 23:05 GMT
All,
Just to end this -- its looks like I had installed the Tomcat "patch"
classes in the wrong directory structure. I wasn't paying too much
attention to this since the doc indicated this is really just for JSPs
not in the root of your web app, but in fact its needed any time to
debug JSPs. Once I fixed the patch install problem, everything
started working.
Another thing -- I assume its normal for the debugger to not highlight
the line being executed in the .java file. The thread indicates what
line is being executed, so its not that big of a deal to follow along,
but I expected the debugger to keep in sync. It did under WSAD 5.0
when debugging .java and .jsp files.
Thanks for the help,
-Craig