Java debugger can't find JSP source code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Java debugger can't find JSP source code

Igal Sapir
I am setting a breakpoint in a JSP file and it breaks as expected when I
connect with jdb.  But when I try to show the source code near the
breakpoint, I get an error message.

1) I am using the default webapps/ROOT/index.jsp that ships with Tomcat.

2) I have set the init-params suppressSmap=false and dumpSmap=true, and can
see the file index_jsp.class, index_jsp.class.smap [1], and index_jsp.java
in work/Catalina/localhost/ROOT/org/apache/jsp.

3) I run Tomcat with the VM options:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

4) I connect to Tomcat at port 8000 with jdb, trying to specify the
sourcepath:
jdb -attach localhost:8000 -sourcepath
webapps/ROOT:work/Catalina/localhost/ROOT

5) I set a breakpoint with JDB:
stop at org.apache.jsp.index_jsp:16

6) I call localhost:8080 and hit the breakpoint:
Breakpoint hit: "thread=http-nio-8080-exec-1",
org.apache.jsp.index_jsp._jspService(), line=16 bci=157

7) I run the list command, which I expect to show me the source code from
index.jsp near the breakpoint, but I get an error message:
Source file not found: index.jsp

I have tried every path I could think of but to no avail.  What am I
missing?

Thank you,

Igal

[1] $ cat work/Catalina/localhost/ROOT/org/apache/jsp/index_jsp.class.smap
SMAP
index_jsp.java
JSP
*S JSP
*F
+ 0 index.jsp
index.jsp
*L
16,2:115
19,7:118
25,5:125
30:130,3
31,7:133
38:140,3
39:143
40,4:144,3
44:156
45,2:157,3
47,3:163
50:166,3
51,9:169
60,3:178,3
63,19:187
82,2:206,3
84,4:212
88,2:216,3
90,4:222
94:226,3
95,18:229
113:247,3
114:250
115,4:251,3
119,5:263
124,2:268,3
126,6:274
132:280,3
133,7:283
140:290,5
141,2:295
143:297,3
144,2:300
146:302,3
147,2:305
149,2:307,3
151:313
152:314,3
153,12:317
165,4:329,3
169,7:341
176,4:348,3
180,7:360
187,3:367,3
190,8:376
198,2:384,3
200,9:390
209,2:399,3
211:405
212:406,3
213,5:409
218:414,3
219,5:417
*E