Discussion:
JSP debugging in the .JSP file and NOT the generated servlet?
Tanvir Hassan
2001-11-02 08:47:42 UTC
Permalink
Hi!

I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).

Is this known behavior? When will NB allow true debugging of JSP pages?

I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.

Thanks!
Damian Frach
2001-11-02 10:35:52 UTC
Permalink
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from www.sun.com).

Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debugging of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
Sasvata (Shash) Chatterjee
2001-11-02 15:08:12 UTC
Permalink
Damian,

I was able to select a JSP node, right-click and do "View Servlet" and
then was able to set breakpoints in the servlet (NB-3.3beta2). The
breakpoint actually hits, as you can see in the debugger window
call-stack, but the problem (or complaint) is about the source window
not highlighting either the breakpoint when it is set (but not hit) or
highlighting the current line as you single-step. Is there a way to
change the look&feel regarding this?

Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debugging of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
Damian Frach
2001-11-05 10:17:01 UTC
Permalink
I was able to select a JSP node, right-click and do "View Servlet" and
then was able to set breakpoints in the servlet (NB-3.3beta2). The
breakpoint actually hits, as you can see in the debugger window call-stack,
but the problem (or complaint) is about the source window not highlighting
either the breakpoint when it is set (but not hit) or highlighting the
current line as you single-step. Is there a way to change the look&feel
regarding this?
If you use the Forte 30, there is full JSP debugging support with very nice
JSP-servlet line mapping. You just add JSP breakpoint and servlet
breakpoints are automatically created.

Damian.

It will be part of the Netbeans, but in the 3.4 or 4.0 version.







Shash

Damian Frach wrote:

No, the JSP debugging is only in the Forte 3.0 now.Forte is free and based
on the Netbeans (downloadable from www.sun.com).Damian.
-----Original Message-----From: Tanvir Hassan [mailto:***@mail.org]Sent:
Friday, November 02, 2001 9:48To: ***@netbeans.orgSubject: [nbusers] JSP
debugging in the .JSP file and NOT the generatedservlet?Hi!I am new to NB
and I had heard that the current NB beta 3.3b2 supported JSPdebugging in its
internal Tomcat instance. When I try to do this, NONE ofmy breakpoints get
triggered (but I am allowed to set them). But I canbring up the generated
servlet for the JSP page and put breakpoints there(but the GUI does not show
them...pretty frustrating) and the servlet breaksDO get triggered (but I do
not see any highlighting or other GUI hint that abreakpoint in the servlet
code has been hit).Is this known behavior? When will NB allow true debuggi
ng of JSP pages?I ask, because my Java developers will be able to deal with
servletdebugging...but my JSP/HTML guys will definitely NOT be able to do
non true.JSP debugging.Thanks!
Shash Chatterjee
2001-11-05 12:33:28 UTC
Permalink
Damian,

Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint
in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The problem
is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.

Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this?
If you use the Forte 30, there is full JSP debugging support with very
nice JSP-servlet line mapping. You just add JSP breakpoint and servlet
breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
Damian Frach
2001-11-05 14:42:37 UTC
Permalink
Offically the Netbeans 3.3 suports only stand-alone servlet debugging.

The JSP and generated servlet debugging is supported only in the Forte 3.0 and is NOT in the Netbeans 3.3.

So there will be no changes in the JSP debugging in the Netbeans 3.3.

Damian.
-----Original Message-----
Sent: Monday, November 05, 2001 13:33
Subject: Re: [nbusers] JSP debugging in the .JSP file and NOT the
generated servlet?
Damian,
Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint
in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The problem
is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.
Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this?
If you use the Forte 30, there is full JSP debugging support with very
nice JSP-servlet line mapping. You just add JSP breakpoint and servlet
breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
Marian Petras
2001-11-06 14:56:02 UTC
Permalink
Hi.
I am a developer of NetBeans debugger modules. If I understand correctly,
you have problems with debugging Java class generated from JSP. Debugging
of *all* Java classes (regardless how they are generated) should be
possible using NetBeans debugger.

The only problem may arise when the classes do not contain necessary
debugging information (information about source name and line number) - in
this case, the debugger may not be able to determine current source and/or
current line. For Sun's Javac, this information is generated by default.
You can specify which debugging information is generated by passing the
"-g" switch to Javac (see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html#options).

Could you (generate and) send me some simple servlet you are not able to
debug, please? Thank you.

Marian
Post by Sasvata (Shash) Chatterjee
Damian,
Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint
in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The problem
is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.
Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this?
If you use the Forte 30, there is full JSP debugging support with very
nice JSP-servlet line mapping. You just add JSP breakpoint and servlet
breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
--
Marian Petras <***@sun.com>
NetBeans, Debugger modules & L10N <http://www.netbeans.org/>
Sun Microsystems, Inc. <http://www.sun.com/>
Marian Petras
2001-11-06 18:05:53 UTC
Permalink
Hi. Here is a story from the first investigation of the problem:

I installed Tomcat 4.0 eventually. I started it in debugging mode,
attached to it from NetBeans, set some (line) breakpoints, started a
servlet ("HelloWorldExample") and... nothing happened. The breakpoint was
not hit. So I set a breakpoint on all methods of class HelloWorldExample
and tried again. Yes! The breakpoint was hit and the debugger... displayed
an error dialog about wrong line number.

I dismissed the error dialog and looked in the Debugger Window. Most of
the entries report line number -1. When I decompiled the .class file, the
decompiler did not generate any line number annotations.

Conclusion:
1) The compiled servlets do not contain information about line numbers.
2) As a result, line breakpoints do not work (they need line numbers).
3) There is a bug in debugger - an error dialog is thrown if the debugged
.class file does not contains information about line numbers.
4) It is not a debugger's bug that you cannot see position in a file.
Debugger does not have any source of information (debugging information
missing).

Marian
Post by Marian Petras
Hi.
I am a developer of NetBeans debugger modules. If I understand
correctly, you have problems with debugging Java class generated from
JSP. Debugging of *all* Java classes (regardless how they are generated)
should be possible using NetBeans debugger.
The only problem may arise when the classes do not contain necessary
debugging information (information about source name and line number) -
in this case, the debugger may not be able to determine current source
and/or current line. For Sun's Javac, this information is generated by
default. You can specify which debugging information is generated by
passing the "-g" switch to Javac (see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html#options).
Could you (generate and) send me some simple servlet you are not able to
debug, please? Thank you.
Marian
Post by Sasvata (Shash) Chatterjee
Damian,
Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint
in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The problem
is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.
Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this? If you use the Forte 30, there is full JSP debugging
support with very nice JSP-servlet line mapping. You just add JSP
breakpoint and servlet breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from
www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
--
Marian Petras <***@sun.com>
NetBeans, Debugger modules & L10N <http://www.netbeans.org/>
Sun Microsystems, Inc. <http://www.sun.com/>
Sasvata (Shash) Chatterjee
2001-11-07 15:22:29 UTC
Permalink
Marian,

Thanks for sticking with the issue. I took some time to create some
screenshots of the problem. In the interest of not stuffing everybody's
mailboxes with large JPEGs, I included URLs only here.

I am using Tomcat-3.2 as bundled with NB-3.3.3, not Tomcat-4.0 as you
used. With this version of the NB-Tomcat integration, it seems that
JSPs are being compiled with debug-symbols. And, I agree that this is
not a core debugger problem, but a problem in the IDE integration of
breakpoints/debugger.

Step 1: Open JAVA servlet generated from JSP ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-1.htm>)
Step 2: In the source window, put the cursor on line 57, as seen on the
bottom left corner of the source-window. Use Debug->Add Breakpoint to
set a breakpoint. Change the breakpoint type to "Line" ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-2.htm>).
Problem 1: Line number is not shown properly in the popup,
although it works
Problem 2: In the source window, the context-menu has
"Toggle Breakpoint" greyed out ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-3.htm>)
Step 3: Select the "WEB-INF" node in Explorer, click Debug-Start (
screenshot <http://expresso.badfw.org/html/howto/netbeans/example-4.htm>)
Step 4: NB switches to Debugging tab, the browser pops up and you can
see that the breakpoint was set correctly on line 57, but not reached
yet ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-5.htm>)
Step 5: Accessed particular URL in browser, triggering breakpoint.
CallStack shows proper line number. But line in source window is not
highlighted ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-6.htm>)
Step 6: Single-step twice, and each time the call-stack shows the
correctl (incremented) line number. The bottom left corner of source
window also shows correct line number. Still no highlighting in the
source window ( screenshot
<http://expresso.badfw.org/html/howto/netbeans/example-7.htm>)

HTH,
Shash

PS: If you trouble accessing links from above, here are the raw URLs for
the screenshots:

http://expresso.badfw.org/html/howto/netbeans/example-1.htm
http://expresso.badfw.org/html/howto/netbeans/example-2.htm
http://expresso.badfw.org/html/howto/netbeans/example-3.htm
http://expresso.badfw.org/html/howto/netbeans/example-4.htm
http://expresso.badfw.org/html/howto/netbeans/example-5.htm
http://expresso.badfw.org/html/howto/netbeans/example-6.htm
http://expresso.badfw.org/html/howto/netbeans/example-7.htm
Post by Marian Petras
I installed Tomcat 4.0 eventually. I started it in debugging mode,
attached to it from NetBeans, set some (line) breakpoints, started a
servlet ("HelloWorldExample") and... nothing happened. The breakpoint
was not hit. So I set a breakpoint on all methods of class
HelloWorldExample and tried again. Yes! The breakpoint was hit and the
debugger... displayed an error dialog about wrong line number.
I dismissed the error dialog and looked in the Debugger Window. Most
of the entries report line number -1. When I decompiled the .class
file, the decompiler did not generate any line number annotations.
1) The compiled servlets do not contain information about line numbers.
2) As a result, line breakpoints do not work (they need line numbers).
3) There is a bug in debugger - an error dialog is thrown if the
debugged .class file does not contains information about line numbers.
4) It is not a debugger's bug that you cannot see position in a file.
Debugger does not have any source of information (debugging
information missing).
Marian
Post by Marian Petras
Hi.
I am a developer of NetBeans debugger modules. If I understand
correctly, you have problems with debugging Java class generated from
JSP. Debugging of *all* Java classes (regardless how they are
generated) should be possible using NetBeans debugger.
The only problem may arise when the classes do not contain necessary
debugging information (information about source name and line number)
- in this case, the debugger may not be able to determine current
source and/or current line. For Sun's Javac, this information is
generated by default. You can specify which debugging information is
generated by passing the "-g" switch to Javac (see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html#options).
Could you (generate and) send me some simple servlet you are not able
to debug, please? Thank you.
Marian
Post by Sasvata (Shash) Chatterjee
Damian,
Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a
breakpoint in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The
problem is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's
just difficult to see which line you are in the Java (not JSP) source.
Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this? If you use the Forte 30, there is full JSP debugging
support with very nice JSP-servlet line mapping. You just add JSP
breakpoint and servlet breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from
www.sun.com).
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the generated
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2 supported JSP
debugging in its internal Tomcat instance. When I try to do this, NONE of
my breakpoints get triggered (but I am allowed to set them). But I can
bring up the generated servlet for the JSP page and put
breakpoints there
(but the GUI does not show them...pretty frustrating) and the servlet breaks
DO get triggered (but I do not see any highlighting or other GUI hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do non true
.JSP debugging.
Thanks!
Damian Frach
2001-11-08 10:03:05 UTC
Permalink
Hi all,

some informations about JSP/servlet debugger support:

NB 3.3:

FULL SUPPORT: stand-alone servlet debugging
NO OFFICIAL SUPPORT: JSP/generated servlet debugging

NB 3.4 / NB4.0 :

FULL SUPPORT: stand-alone servlet debugging
FULL SUPPORT: JSP/generated servlet debugging

FORTE 3.0

FULL SUPPORT: stand-alone servlet debugging
FULL SUPPORT: JSP/generated servlet debugging

Damian.

PS:

If you are not satisfied with JSP/generated servlet debugging in the NB 3.3,
you have to wait for NB 3.4/4.0 or now use Forte 3.0.
There is NO official support for the JSP/generated servlet debugging.

Forte is free and based on the NB. (more info www.sun.com)
-----Original Message-----
From: Sasvata (Shash) Chatterjee [mailto:***@flash.net]
Sent: Wednesday, November 07, 2001 16:22
To: ***@netbeans.org
Cc: ***@sun.com; ***@sun.com
Subject: Re: [nbusers] Correction: JSP debugging in the .JSP file and NOT
the generated servlet?


Marian,

Thanks for sticking with the issue. I took some time to create some
screenshots of the problem. In the interest of not stuffing everybody's
mailboxes with large JPEGs, I included URLs only here.

I am using Tomcat-3.2 as bundled with NB-3.3.3, not Tomcat-4.0 as you
used. With this version of the NB-Tomcat integration, it seems that JSPs
are being compiled with debug-symbols. And, I agree that this is not a core
debugger problem, but a problem in the IDE integration of
breakpoints/debugger.

Step 1: Open JAVA servlet generated from JSP ( screenshot)
Step 2: In the source window, put the cursor on line 57, as seen on the
bottom left corner of the source-window. Use Debug->Add Breakpoint to set a
breakpoint. Change the breakpoint type to "Line" ( screenshot).
Problem 1: Line number is not shown properly in the popup,
although it works
Problem 2: In the source window, the context-menu has "Toggle
Breakpoint" greyed out ( screenshot)
Step 3: Select the "WEB-INF" node in Explorer, click Debug-Start
screenshot)
Step 4: NB switches to Debugging tab, the browser pops up and you can see
that the breakpoint was set correctly on line 57, but not reached yet
screenshot)
Step 5: Accessed particular URL in browser, triggering breakpoint.
CallStack shows proper line number. But line in source window is not
highlighted ( screenshot)
Step 6: Single-step twice, and each time the call-stack shows the correctl
(incremented) line number. The bottom left corner of source window also
shows correct line number. Still no highlighting in the source window
screenshot)

HTH,
Shash

PS: If you trouble accessing links from above, here are the raw URLs for
the screenshots:

http://expresso.badfw.org/html/howto/netbeans/example-1.htm
http://expresso.badfw.org/html/howto/netbeans/example-2.htm
http://expresso.badfw.org/html/howto/netbeans/example-3.htm
http://expresso.badfw.org/html/howto/netbeans/example-4.htm
http://expresso.badfw.org/html/howto/netbeans/example-5.htm
http://expresso.badfw.org/html/howto/netbeans/example-6.htm
http://expresso.badfw.org/html/howto/netbeans/example-7.htm

Marian Petras wrote:

Hi. Here is a story from the first investigation of the problem:

I installed Tomcat 4.0 eventually. I started it in debugging mode,
attached to it from NetBeans, set some (line) breakpoints, started a servlet
("HelloWorldExample") and... nothing happened. The breakpoint was not hit.
So I set a breakpoint on all methods of class HelloWorldExample and tried
again. Yes! The breakpoint was hit and the debugger... displayed an error
dialog about wrong line number.

I dismissed the error dialog and looked in the Debugger Window. Most of
the entries report line number -1. When I decompiled the .class file, the
decompiler did not generate any line number annotations.

Conclusion:
1) The compiled servlets do not contain information about line numbers.
2) As a result, line breakpoints do not work (they need line numbers).
3) There is a bug in debugger - an error dialog is thrown if the
debugged .class file does not contains information about line numbers.
4) It is not a debugger's bug that you cannot see position in a file.
Debugger does not have any source of information (debugging information
missing).

Marian


Marian Petras wrote:


Hi.
I am a developer of NetBeans debugger modules. If I understand
correctly, you have problems with debugging Java class generated from JSP.
Debugging of *all* Java classes (regardless how they are generated) should
be possible using NetBeans debugger.

The only problem may arise when the classes do not contain necessary
debugging information (information about source name and line number) - in
this case, the debugger may not be able to determine current source and/or
current line. For Sun's Javac, this information is generated by default. You
can specify which debugging information is generated by passing the "-g"
switch to Javac (see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html#options).

Could you (generate and) send me some simple servlet you are not able
to debug, please? Thank you.

Marian


Shash Chatterjee wrote:


Damian,

Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint in
the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The
problem is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.

Shash

Damian Frach wrote:


I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see
in
the debugger window call-stack, but the problem (or complaint)
is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line
as
you single-step. Is there a way to change the look&feel
regarding
this? If you use the Forte 30, there is full JSP debugging
support with very nice JSP-servlet line mapping. You just add JSP breakpoint
and servlet breakpoints are automatically created.



Damian.



It will be part of the Netbeans, but in the 3.4 or 4.0 version.













Shash

Damian Frach wrote:


No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from
www.sun.com).

Damian.


-----Original Message-----
From: Tanvir Hassan [mailto:***@mail.org]
Sent: Friday, November 02, 2001 9:48
To: ***@netbeans.org
Subject: [nbusers] JSP debugging in the .JSP file and NOT the
generated
servlet?


Hi!

I am new to NB and I had heard that the current NB beta 3.3b2
supported JSP
debugging in its internal Tomcat instance. When I try to do
this, NONE of
my breakpoints get triggered (but I am allowed to set them).
But I can
bring up the generated servlet for the JSP page and put
breakpoints there
(but the GUI does not show them...pretty frustrating) and the
servlet breaks
DO get triggered (but I do not see any highlighting or other
GUI hint that a
breakpoint in the servlet code has been hit).

Is this known behavior? When will NB allow true debuggi
ng of JSP pages?

I ask, because my Java developers will be able to deal with
servlet
debugging...but my JSP/HTML guys will definitely NOT be able
to do non true
.JSP debugging.

Thanks!
Damian Frach
2001-11-08 10:20:47 UTC
Permalink
Just one correction:
If you are not satisfied with JSP/generated servlet debugging in the NB
3.3, you have to wait for NB 3.4/4.0 or now use Forte 3.0.
There is NO official support for the JSP/generated servlet debugging.

There is NO official support for the JSP/generated servlet debugging in the
NB 3.3.

Damian.
Sasvata (Shash) Chatterjee
2001-11-08 14:50:04 UTC
Permalink
Post by Damian Frach
If you are not satisfied with JSP/generated servlet debugging in
the NB 3.3, you have to wait for NB 3.4/4.0 or now use Forte 3.0.
There is NO official support for the JSP/generated servlet debugging.
There is NO official support for the JSP/generated servlet debugging
in the NB 3.3.
Damian.
OK...how about some "unofficial" support then :-). Just kidding, of
course! You guys have done a great job, and I appreciate you guys'
usually prompt answers on the list!

Shash

Tanvir Hassan
2001-11-07 06:32:51 UTC
Permalink
I wonder if there is a way to tell Tomcat to compile the JSP -> servlet
class with the "-g" option...

I know with C I could generate C files and put in my own #line directives to
the compiler so that the obj would build with debugging line info according
to my #line directive. I wonder if the Tomcat JSP -> servlet .java
generator could do the same so it would be easier to develop debuggers for
JSPs.

Also, I wonder if we could get the JSP -> servlet generator to automatically
generate .java files WITH the
Post by Marian Petras
Hi.
I am a developer of NetBeans debugger modules. If I understand correctly,
you have problems with debugging Java class generated from JSP. Debugging
of *all* Java classes (regardless how they are generated) should be
possible using NetBeans debugger.
The only problem may arise when the classes do not contain necessary
debugging information (information about source name and line number) - in
this case, the debugger may not be able to determine current source and/or
current line. For Sun's Javac, this information is generated by default.
You can specify which debugging information is generated by passing the
"-g" switch to Javac (see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html#options).
Could you (generate and) send me some simple servlet you are not able to
debug, please? Thank you.
Marian
Post by Sasvata (Shash) Chatterjee
Damian,
Sorry if I didn't explain my question carefully enough. I am *not*
asking about setting a breakpoint in the JSP, but setting a breakpoint
in the *servlet* generated from the JSP.
That I think *is* supported in Netbeans-3.3 (beta-1/2/3). The problem
is that when the breakpoint is hit, the line doesn't show up
highlighted. You can still single-step and debug as normal, it's just
difficult to see which line you are in the Java (not JSP) source.
Shash
Post by Sasvata (Shash) Chatterjee
I was able to select a JSP node, right-click and do "View
Servlet" and then was able to set breakpoints in the servlet
(NB-3.3beta2). The breakpoint actually hits, as you can see in
the debugger window call-stack, but the problem (or complaint) is
about the source window not highlighting either the breakpoint
when it is set (but not hit) or highlighting the current line as
you single-step. Is there a way to change the look&feel regarding
this?
If you use the Forte 30, there is full JSP debugging support with very
nice JSP-servlet line mapping. You just add JSP breakpoint and servlet
breakpoints are automatically created.
Damian.
It will be part of the Netbeans, but in the 3.4 or 4.0 version.
Shash
Post by Damian Frach
No, the JSP debugging is only in the Forte 3.0 now.
Forte is free and based on the Netbeans (downloadable from
www.sun.com).
Post by Marian Petras
Post by Sasvata (Shash) Chatterjee
Post by Sasvata (Shash) Chatterjee
Post by Damian Frach
Damian.
-----Original Message-----
Sent: Friday, November 02, 2001 9:48
Subject: [nbusers] JSP debugging in the .JSP file and NOT the
generated
Post by Marian Petras
Post by Sasvata (Shash) Chatterjee
Post by Sasvata (Shash) Chatterjee
Post by Damian Frach
servlet?
Hi!
I am new to NB and I had heard that the current NB beta 3.3b2
supported JSP
debugging in its internal Tomcat instance. When I try to do this,
NONE of
my breakpoints get triggered (but I am allowed to set them). But I
can
Post by Marian Petras
Post by Sasvata (Shash) Chatterjee
Post by Sasvata (Shash) Chatterjee
Post by Damian Frach
bring up the generated servlet for the JSP page and put breakpoints
there
(but the GUI does not show them...pretty frustrating) and the
servlet breaks
DO get triggered (but I do not see any highlighting or other GUI
hint that a
breakpoint in the servlet code has been hit).
Is this known behavior? When will NB allow true debuggi
ng of JSP pages?
I ask, because my Java developers will be able to deal with servlet
debugging...but my JSP/HTML guys will definitely NOT be able to do
non true
.JSP debugging.
Thanks!
--
NetBeans, Debugger modules & L10N <http://www.netbeans.org/>
Sun Microsystems, Inc. <http://www.sun.com/>
Loading...