Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Debugging JSPs (breakpoints) does not work
Debugging JSPs (breakpoints) does not work [message #188561] Sat, 24 February 2007 18:57 Go to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

Hi,

we are working on a JSP-based wiki-system and ported the project structure
to a WTP 'dynamic web project' just recently. We use the WTP-Server
project container to deploy the wiki in a Tomcat 5.5 instance.

I noticed however that debugging JSPs does not work, i.e. breakpoints in
JSPs are never activated (they always miss the checkmark indicating that
the breakpoint is reachable). Debugging normal Java classes works just
fine.

Any ideas why this doesn't work? The documentation indicates that this
should be possible out-of-the-box.

Thanks in advance,
Matthias

PS: I tried activating the "Enable Tomcat debug mode" in the server
settings panel (effectively adding the -debug flag to the server startup
context), but this only yields an error message:
"Bootstrap: command "-debug" does not exist."
Re: Debugging JSPs (breakpoints) does not work [message #188575 is a reply to message #188561] Sun, 25 February 2007 17:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

Meanwhile I noticed a bug report indicating that WTP 1.x screws up the
order of the -debug flag which is inserted after the 'start' command in
the run-config (as opposed to before it) and also doesn't correctly remove
it again when unchecking debug mode. According to the report, this will be
fixed in 2.0.

However, even when I manually place the -debug flag before the 'start'
command in the run config, I only get a usage message from tomcat:

usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [
-nonaming ] { start | stop }

It seemingly doesn't support a flag called '-debug' at all.

Does that mean I can't debug JSPs with Tomcat whatsoever?

-M.
Re: Debugging JSPs (breakpoints) does not work [message #188866 is a reply to message #188561] Thu, 01 March 2007 09:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

The problem still occurs, is anyone here using Tomcat 5.5 with WTP who can
help?

That'd be great.
Re: Debugging JSPs (breakpoints) does not work [message #188993 is a reply to message #188561] Fri, 02 March 2007 19:41 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I'm not sure what you mean by "they always miss the checkmark indicating
that the breakpoint is reachable". I'm able to set breakpoints in JSPs,
provided it is within Java related code in the JSP. I haven't
encountered problems with hitting these breakpoints when running the
server in debug mode and accessing the JSP page.

Cheers,
Larry

Matthias Käppler wrote:
> Hi,
>
> we are working on a JSP-based wiki-system and ported the project
> structure to a WTP 'dynamic web project' just recently. We use the
> WTP-Server project container to deploy the wiki in a Tomcat 5.5 instance.
>
> I noticed however that debugging JSPs does not work, i.e. breakpoints in
> JSPs are never activated (they always miss the checkmark indicating that
> the breakpoint is reachable). Debugging normal Java classes works just
> fine.
>
> Any ideas why this doesn't work? The documentation indicates that this
> should be possible out-of-the-box.
>
> Thanks in advance,
> Matthias
>
> PS: I tried activating the "Enable Tomcat debug mode" in the server
> settings panel (effectively adding the -debug flag to the server startup
> context), but this only yields an error message:
> "Bootstrap: command "-debug" does not exist."
>
Re: Debugging JSPs (breakpoints) does not work [message #189000 is a reply to message #188575] Fri, 02 March 2007 19:43 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
The -debug flag had to do with logging control in Tomcat 4.x and has
little or no practical use in Tomcat 5.x and later. It doesn't have any
impact on debugging JSPs using breakpoints.

Cheers,
Larry

Matthias Käppler wrote:
> Meanwhile I noticed a bug report indicating that WTP 1.x screws up the
> order of the -debug flag which is inserted after the 'start' command in
> the run-config (as opposed to before it) and also doesn't correctly
> remove it again when unchecking debug mode. According to the report,
> this will be fixed in 2.0.
>
> However, even when I manually place the -debug flag before the 'start'
> command in the run config, I only get a usage message from tomcat:
>
> usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ]
> [ -nonaming ] { start | stop }
>
> It seemingly doesn't support a flag called '-debug' at all.
>
> Does that mean I can't debug JSPs with Tomcat whatsoever?
>
> -M.
>
Re: Debugging JSPs (breakpoints) does not work [message #189057 is a reply to message #188993] Sat, 03 March 2007 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

Larry Isaacs wrote:

> I'm not sure what you mean by "they always miss the checkmark indicating
> that the breakpoint is reachable".

AFAIK the small checkmark overlay on a breakpoint icon indicates that a
breakpoint is reachable in terms of execution flow. That is never the case
for me with breakpoints in JSPs. Plus, when I open a JSP, set a breakpoint
and then select "Debug As --> Debug on server" I get an error message:
"Server Error - The selection is not within a valid module".

What does that mean?

-M.
Re: Debugging JSPs (breakpoints) does not work [message #189134 is a reply to message #189057] Mon, 05 March 2007 16:00 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I believe it is normal not to get the check marks. When a server is
launched, I don't think JDT "understands" what is being "run" (i.e.
served) in terms of web projects, so it doesn't add the check marks like
it does for Java applications. This shouldn't prevent the breakpoint
from working.

The "not within a valid module" problem has been a stubborn bug that
should be fixed in WTP 1.5.3 and WTP 2.0. It means that the resource is
in a project whose module can't be successfully associated with a
server able to serve it. In the past, this problem has occurred because
the Static Web Project type has been overzealous in claiming that
resources in a Dynamic Web Project are in a static web module, which
Tomcat can't serve. Which version of WTP are you using?

Cheers,
Larry

Matthias Käppler wrote:
> Larry Isaacs wrote:
>
>> I'm not sure what you mean by "they always miss the checkmark
>> indicating that the breakpoint is reachable".
>
> AFAIK the small checkmark overlay on a breakpoint icon indicates that a
> breakpoint is reachable in terms of execution flow. That is never the
> case for me with breakpoints in JSPs. Plus, when I open a JSP, set a
> breakpoint and then select "Debug As --> Debug on server" I get an error
> message: "Server Error - The selection is not within a valid module".
>
> What does that mean?
>
> -M.
>
Re: Debugging JSPs (breakpoints) does not work [message #189166 is a reply to message #188561] Tue, 06 March 2007 08:33 Go to previous messageGo to next message
Sebastian Beigel is currently offline Sebastian BeigelFriend
Messages: 6
Registered: July 2009
Junior Member
Hi everybody,

this is kind of a follow-up, because the subject matches but the problem
is a slightly different one :)

I'm using WTP2.0M5 (w/ Eclipse 3.3M5eh) and it is not possible to set
any breakpoints in JSP files (for HTML/"JSP" content).

Neither double-clicking in the right side bar (the "Add bookmark" dialog
appears instead) nor the context menu entry "Toggle breakpoint" adds a
breakpoint to the JSP.

Setting breakspoints in scriptlets (<%...%> in a JSP file) works: The
breakpoint is set and the debugger stops correctly.

I've found this "problem" a few times doing a Google search but no
solution was described (yet).

I remeber that setting breakpoints in JSPs was not possible using a lot
of WTP/Eclipse combinations in the past (at least for me). For now I can
assure (and test) that it doesn't work in my current set up on Win
XP/Win Vista and JDK 1.5/JDK 1.6 using Tomcat 5.5.20.

Any ideas? Some mis-configuration on my side?

Thank you,
Sebastian
Re: Debugging JSPs (breakpoints) does not work [message #189181 is a reply to message #189166] Tue, 06 March 2007 14:16 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I don't believe setting a breakpoint in the HTML portion of a JSP file
is supported. However, having "<% %>" is enough to allow a breakpoint
to be set. If you can temporarily add this above the line you want to
breakpoint, you can accomplish the same thing.

Cheers,
Larry

Sebastian Beigel wrote:
> Hi everybody,
>
> this is kind of a follow-up, because the subject matches but the problem
> is a slightly different one :)
>
> I'm using WTP2.0M5 (w/ Eclipse 3.3M5eh) and it is not possible to set
> any breakpoints in JSP files (for HTML/"JSP" content).
>
> Neither double-clicking in the right side bar (the "Add bookmark" dialog
> appears instead) nor the context menu entry "Toggle breakpoint" adds a
> breakpoint to the JSP.
>
> Setting breakspoints in scriptlets (<%...%> in a JSP file) works: The
> breakpoint is set and the debugger stops correctly.
>
> I've found this "problem" a few times doing a Google search but no
> solution was described (yet).
>
> I remeber that setting breakpoints in JSPs was not possible using a lot
> of WTP/Eclipse combinations in the past (at least for me). For now I can
> assure (and test) that it doesn't work in my current set up on Win
> XP/Win Vista and JDK 1.5/JDK 1.6 using Tomcat 5.5.20.
>
> Any ideas? Some mis-configuration on my side?
>
> Thank you,
> Sebastian
Re: Debugging JSPs (breakpoints) does not work [message #189651 is a reply to message #189134] Mon, 12 March 2007 15:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

Larry Isaacs wrote:

> The "not within a valid module" problem has been a stubborn bug that
> should be fixed in WTP 1.5.3 and WTP 2.0. [...]

I'm using WTP 1.5.3. Are you sure it was claimed to be fixed for this
version? Otherwise I would reopen the bug report, as it seemingly is still
making trouble. In fact, I can't debug anything besides plain old Java
sources right now. I also can't debug custom JSP tags, which in fact are
implemented as plain Java.

Regards,
Matthias
Re: Debugging JSPs (breakpoints) does not work [message #189668 is a reply to message #189651] Mon, 12 March 2007 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matthias.kaeppler.dfki.de

Matthias Käppler wrote:

> Larry Isaacs wrote:

>> The "not within a valid module" problem has been a stubborn bug that
>> should be fixed in WTP 1.5.3 and WTP 2.0. [...]

> I'm using WTP 1.5.3. Are you sure it was claimed to be fixed for this
> version? Otherwise I would reopen the bug report, as it seemingly is still
> making trouble. In fact, I can't debug anything besides plain old Java
> sources right now. I also can't debug custom JSP tags, which in fact are
> implemented as plain Java.

> Regards,
> Matthias

I just made an interesting observation regarding this topic, by mere
coincidence actually (while messing around with the run config):

The "selection is not within a valid module" error only occurs, when I try
to debug a JSP like this:

1) Open the JSP
2) right click inside --> Debug as... --> Debug on server

However, if I do it like this:

1) Open JSP
2) right click --> Debug as... --> Debug... and then manually select the
default run target (which should actually be the very same as when
directly saying "debug on server", especially since I only have one single
run config for that project and server), then it works!

However, I have to explicitly do this for *every* JSP I want to debug
*separately*, which is just plain annoying.

What I still don't understand is why it seems to work fine for everyone
else. Do you think I should file a new bug report regarding this issue?

Cheers,
Matthias
Re: Debugging JSPs (breakpoints) does not work [message #189684 is a reply to message #189668] Mon, 12 March 2007 16:51 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
The only "not within a valid module" bug that is still around is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166419. It seems to occur
only if a certain plug-in startup order occurs. It only applied to
invoking Run, Debug, and Profile on Server from the editor's context
menu. Using Run, Debug, and Profile on Server when selecting the JSP in
the Project Explorer, Package Explorer, or Navigator views still worked,
if I recall correctly. Does Debug On Server fail when using one of
these navigator views?

The Debug As -> Debug approach simply runs the chosen server, which is
equivalent clicking the "Debug" icon in the Servers view. No attempt
will be made to open the resource in a browser. The Debug on Server
tries to match the selected resource to a server to create a URL with
which to invoke the browser. It's that "matching" operation that is
causing the problem.

With respect to breakpoints not working, where did your Tomcat come
from, i.e. did you download it, unzip or install it, and use it without
any configuration changes? When you create a Tomcat server, it uses its
current configuration, which may or may not be development friendly.
The default configuration that comes with the download is known to be
development friendly.

Cheers,
Larry


Matthias Käppler wrote:
> Matthias Käppler wrote:
>
>> Larry Isaacs wrote:
>
>>> The "not within a valid module" problem has been a stubborn bug that
>>> should be fixed in WTP 1.5.3 and WTP 2.0. [...]
>
>> I'm using WTP 1.5.3. Are you sure it was claimed to be fixed for this
>> version? Otherwise I would reopen the bug report, as it seemingly is
>> still making trouble. In fact, I can't debug anything besides plain
>> old Java sources right now. I also can't debug custom JSP tags, which
>> in fact are implemented as plain Java.
>
>> Regards,
>> Matthias
>
> I just made an interesting observation regarding this topic, by mere
> coincidence actually (while messing around with the run config):
>
> The "selection is not within a valid module" error only occurs, when I
> try to debug a JSP like this:
>
> 1) Open the JSP
> 2) right click inside --> Debug as... --> Debug on server
>
> However, if I do it like this:
>
> 1) Open JSP
> 2) right click --> Debug as... --> Debug... and then manually select the
> default run target (which should actually be the very same as when
> directly saying "debug on server", especially since I only have one
> single run config for that project and server), then it works!
>
> However, I have to explicitly do this for *every* JSP I want to debug
> *separately*, which is just plain annoying.
>
> What I still don't understand is why it seems to work fine for everyone
> else. Do you think I should file a new bug report regarding this issue?
>
> Cheers,
> Matthias
>
Re: Debugging JSPs (breakpoints) does not work [message #1822070 is a reply to message #189166] Wed, 26 February 2020 15:16 Go to previous messageGo to next message
robert estey is currently offline robert esteyFriend
Messages: 1
Registered: February 2020
Junior Member
This continues to be a problem with JSPs. What I have found is removing the project and then readding the project. That use to work in the past.

The BOOKMARK issue came back again. I see a lot of posts saying you must put the breakpoint within Java Code. Yes, we get it, however, there are times this doesn't work.

What other settings / configurations are possible to ensure that breakpoint is enabled???

<%
code
%>

Once Again, Java Code should be enabled as a BREAKPOINT not the Message "Add Bookmark"
Re: Debugging JSPs (breakpoints) does not work [message #1822701 is a reply to message #1822070] Wed, 11 March 2020 15:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

Assuming you're in the JSP Editor, editing a JSP file in the workspace, and referring to the line that reads "code" and not the ones around it, that should be all.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Debugging JSPs (breakpoints) does not work [message #1833231 is a reply to message #1822701] Wed, 07 October 2020 11:44 Go to previous messageGo to next message
Mark Smith is currently offline Mark SmithFriend
Messages: 82
Registered: September 2020
Member
Check this article
https://stackoverflow.com/questions/53915010/breakpoints-not-working-on-jsp-pages-in-eclipse
Re: Debugging JSPs (breakpoints) does not work [message #1833244 is a reply to message #1833231] Wed, 07 October 2020 15:08 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

Mark, most of your replies appear to be posts to elsewhere that don't always have an answer. What gives?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Debugging JSPs (breakpoints) does not work [message #1841503 is a reply to message #1833244] Wed, 19 May 2021 08:18 Go to previous messageGo to next message
Jack parkar is currently offline Jack parkarFriend
Messages: 1
Registered: March 2021
Junior Member
thank you for the detail.
Re: Debugging JSPs (breakpoints) does not work [message #1855978 is a reply to message #1841503] Mon, 14 November 2022 08:35 Go to previous messageGo to next message
oliver brown is currently offline oliver brownFriend
Messages: 1
Registered: November 2022
Junior Member
Hey, I'm facing the same issue for many days, Is Anyone here to help me out?
Re: Debugging JSPs (breakpoints) does not work [message #1855991 is a reply to message #1855978] Mon, 14 November 2022 19:40 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

Do you have any information about your setup to include? This thread is old, and the same specifics may not apply to you.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:@FacesConfig e JSF version2_3
Next Topic:Implementing a simple Validator for HTML Files
Goto Forum:
  


Current Time: Fri Dec 27 02:20:58 GMT 2024

Powered by FUDForum. Page generated in 0.04435 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top