This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 40530 - Unreliable debugging of JSP XML Document
Summary: Unreliable debugging of JSP XML Document
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Martin Grebac
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-26 16:41 UTC by L Martinek
Modified: 2005-12-14 17:13 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description L Martinek 2004-02-26 16:41:32 UTC
Create JSP Document with following code:

1: <jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
2: <jsp:text>
3: <text>
4: <head>
5: <title>aaa</title>
6: </head>
7: </text>
8: </jsp:text>
9: </jsp:root>

Add breakpoint to line 4 and start debugger.
Debugger will stop on line 5 and if you press F8
debugger will jump to line 8.

Modify above code, change line 5 to
5: aaa

Start debugger. Now debugger will stop on right
line and F8 works correctly. However if you put
breakpoint to line 3, debugger will stop on line 4.

Corresponding servlet code for first example is:

  out.write('\n');
  out.write("<text>");
  out.write("<head>");
  out.write("<title>");
  out.write('a');
  out.write('a');
  out.write('a');
  out.write("</title>");
  out.write("</head>");
  out.write("</text>");
  out.write('\n');

and for modified example:

  out.write('\n');
  out.write("<text>");
  out.write("<head>");
  out.write("\n");
  out.write("aaa\n");
  out.write("</head>");
  out.write("</text>");
  out.write('\n');


There is also other jspx, which can't be almost
debugged. Mount jsp-examples from Tomcat, open
jsp2/jspx/basic.jspx, set breakpoint to line 10
and start debugger. Debugger will not stop on
breakpoint. If you set breakpoint to line 5,
debugger will stop on line 4 and after F8 you will
get out of source so content of this jspx can't be
debugged at all.
Comment 1 Martin Grebac 2004-02-27 23:48:35 UTC
As for case 1 - this is a problem of JSR45 mappings generated by
Tomcat. There are no mappings for skipped lines - so debugger can't do
anything else - just skip those lines. This is correct functionality
of JSR45 debugger which depends on support from server.

As for case 2 - we are not able to debug tag files, and this example
consists only from a custom tag call written in a tag file, so we're
still providing a consistent behaviour here.

So, marking as will not fix.
Comment 2 L Martinek 2004-03-01 13:15:23 UTC
If it can't be fixed I would consider possibility to disable debugging
for JSPX at all. We can discuss it at today meeting.
Comment 3 Martin Grebac 2004-03-01 13:21:50 UTC
Which case are you talking about now?
Comment 4 L Martinek 2004-03-01 13:34:59 UTC
Especially case 1, but also case 2 if JSPX containing one big custom
tag is common use.
Comment 5 Martin Grebac 2004-03-01 15:30:22 UTC
I do consider case 2 as invalid - because the text there is something
like a parameter in the function call - you can't step through
parameters in function call.

Case 1 is a little problem in missing Tomcat mappings (not our code) -
not a P2, because some of the mappings in the text do not exist, so we
do skip them.

However, case 3 is really a P2 and is serious. It's again a problem in
Tomcat mappings, so our code is innocent here ;O) - I'm gonna file a
bug against Tomcat (I already sent an email to Kin-Man) and attach the
number here.

Case3:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:text>
<text>
Sample text
</text>
</jsp:text>

<jsp:scriptlet>
<![CDATA[
    String s = "hehehe";
    System.out.print("s = " + s);
    //comment
    out.print("last");
]]>
</jsp:scriptlet>

<h1>
<jsp:scriptlet>
<![CDATA[  
        for(int i = 0 ; i < 10; i++) {
            System.out.println("debug: " + i);
        }
]]>
</jsp:scriptlet>
</h1>

</jsp:root>

Here, when you get to step in the for-loop, you're looping between
CDATA and for lines, which is completely weird.
Comment 6 Martin Grebac 2004-03-01 15:38:13 UTC
Tomcat bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27338
Comment 7 Martin Grebac 2004-03-02 09:45:49 UTC
KinMan fixed the bug in Tomcat. I'm gonna try it with T's nightly build.
Comment 8 Martin Grebac 2004-03-02 13:39:33 UTC
I verified it works OK with nightly T build.
Comment 9 Martin Grebac 2004-03-03 09:43:21 UTC
Case 1 was fixed in Tomcat, too.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27368
Comment 10 Patrick Keegan 2004-03-03 21:38:48 UTC
What's the status? Will this need a release note?
Comment 11 Martin Grebac 2004-03-04 08:12:37 UTC
 Yes, this will need a release note. Status is:
 both relevant problems were fixed on Tomcat side, and will be part of
Tomcat 5.0.next release (5.0.20, I believe). So, I'm going to follow
the process and send a waiver request.
Comment 12 Patrick Keegan 2004-03-04 14:52:52 UTC
Chris, could you work with Martin on a description of this bug and any
relevant workarounds?
Comment 13 L Martinek 2004-03-04 15:27:37 UTC
The same bug applies to SunOne AppServer so release note should also
mention it.
Comment 14 Chris Kutler 2004-03-05 15:28:56 UTC
Suggested Text:

Lines Stepped Over in JSP Document files (.jspx) During Debugging 

Due to known server bugs, not all JSP lines are mapped to the
corresponding servlet code. Therefore, the debugger steps over some
lines in JSP Document files. Breakpoints are not honored on these
skipped lines and the debugger will step over them when you press F8.
Comment 15 L Martinek 2004-03-19 16:30:36 UTC
I would also mention in release notes that next version of Tomcat
should have this bug fixed so user can register next version of Tomcat
in IDE as new server and use it.
Comment 16 Chris Kutler 2004-03-19 16:51:05 UTC
Can we be more specific about the "next version"? Do we know the
version number?
Comment 17 Martin Grebac 2004-03-19 18:43:20 UTC
It should be 5.0.20, but it wasn't release yet.
Comment 18 Patrick Keegan 2004-03-19 18:47:29 UTC
Let us know when it is released. I don't want to change the release
notes before that.
Comment 19 Martin Grebac 2004-05-21 14:36:14 UTC
It's been fixed in trunk by upgrade to T5.0.24 and it's fixed in
PE8.0.1 or something like that, so marking as fixed.
Comment 20 Jiri Skrivanek 2005-12-14 14:49:30 UTC
Verified.