Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Debugging JSPs (breakpoints) does not work
Debugging JSPs (breakpoints) does not work [message #188561] Sat, 24 February 2007 13:57 Go to next message
Eclipse User
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 12:28 Go to previous messageGo to next message
Eclipse User
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 04:44 Go to previous messageGo to next message
Eclipse User
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 14:41 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1295
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 14:43 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1295
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 12:30 Go to previous messageGo to next message
Eclipse User
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 11:00 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1295
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 03:33 Go to previous messageGo to next message
Sebastian Beigel is currently offline Sebastian Beigel
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 09:16 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1295
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 11:27 Go to previous messageGo to next message
Eclipse User
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 11:57 Go to previous messageGo to next message
Eclipse User
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 12:51 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1295
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
>
Previous Topic:wsgen fails with namespace to pckage mapping file
Next Topic:WSGEN : WSDL URL in axisclient.properties
Goto Forum:
  


Current Time: Wed Jul 23 05:54:58 EDT 2014

Powered by FUDForum. Page generated in 0.03366 seconds