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!