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 226908 - Setting breakpoint in a JSP page makes NetBeans stop at page in other project (but on same server)
Summary: Setting breakpoint in a JSP page makes NetBeans stop at page in other project...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal with 3 votes (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 17:22 UTC by ecerichter
Modified: 2013-09-02 01:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
video showing the wrong behavior (3.78 MB, video/avi)
2013-03-01 17:22 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerichter 2013-03-01 17:22:55 UTC
Created attachment 132079 [details]
video showing the wrong behavior

I've create a sample project.
Then I set a breakpoint in a JSP page.
First problem is that the breakpoint is created in the wrong line (I set in line 20, NetBeans add a breakpoint for line 15). I'll assume that this is for aproximation, and is ok.
Second problem is when start debugging, NetBeans stop at breakpoint, but in wrong page!

See attached video for reference.
Comment 1 ecerichter 2013-03-01 17:27:41 UTC
Comment on attachment 132079 [details]
video showing the wrong behavior

Just to be sure... the index.jsp page presented in the video (at the end) is coming from another project.
As per "breakpoints" window, you can see that there is only one breakpoint set (the one I've added at beginning of the test).
Comment 2 Martin Entlicher 2013-03-04 16:37:35 UTC
I do not think there's an easy resolution to this problem.
You've attached the debugger to the web server, rather then using "Debug" of the project, right?
Then the debugger does not know, which index.jsp is being executed.

This can not be a P1, since it works this way for a long time already and this is a first complaint on this after a long time. Therefore most users likely use Debug Project, which seems to work fine.
We'll keep this as a P3 and we'll see what can we do to distinguish the index.jsp files from different projects.
Comment 3 ecerichter 2013-03-04 23:18:52 UTC
1. It is a clear regression, since I work with NetBeans for a long time, and never ever reached this bug before - and I still work on the same projects as per 7.1 lifetime.

2. As per guidelines, it should become a P1 or P2, never a P3. It is a critical functionality of the system, and is not working properly. The fact that others did not complain is not part of the guidelines (the other side is: too many people complaining by something becomes critical just because the "popularity" of the bug).

3. Your assumption is wrong: I've used the Debug Project (which started the Apache Tomcat), not attached debugger to web server (which causes more harm than good).

4. I don't know if other users work on one project at time. I do it all the time, and NetBeans always worked well with multiple project at once.

5. If you pay attention to the video, you will see I've marked the breakpoint at line 20, and debugger registered the breakpoint at line 15.

6. I think there is an easy solution, you just need to associate the path+filename to the compiled servlet - problem solved (I know it is a simplification of the problem, but I'm sure internals are not deadly that forbid simple solutions to be applied).

Kind regards,

Edson Richter
Comment 4 Jiri Skrivanek 2013-03-05 08:56:31 UTC
I tried it also in NetBeans 7.2.1 and this faulty behaviour is reproducible there. So I think this is not a regression but you probably found the use case that anyone has never tried before. My steps are:

- create web project with Tomcat server
- toggle breakpoint in index.jsp (e.g. line 15)
- debug project
- debugger stops at line 15 in index.jsp
- press F5 to continue debugger
- create another web project with Tomcat server
- toggle breakpoint in index.jsp (e.g. line 12)
- debug project
- debugger stops at line 12 but it focuses index.jsp from the first project and green line annotation is also shown in this file
- if you finish debugging and then debug the second project it behaves correctly
Comment 5 Martin Entlicher 2013-03-05 12:55:10 UTC
Thanks for your further comments, ecerichter.
I'm not aware about any recent changed in JSP debugger, therefore I believe that this is not a regression.
But this definitely should be fixed.
The debugger start was not apparent from the video, thus I was just guessing. On attach, debugger use a classpath of all projects, therefore such issue can occur more easily.

The breakpoint was moved from line 20 to line 15 most probably due to submission to a different class, coming from index.jsp of a different project.

Upgrading to P2 so that we will address this issue into the next release for sure.
Comment 6 Martin Entlicher 2013-03-05 12:55:51 UTC
And thanks Jirka for exact steps to reproduce.
Comment 7 ecerichter 2013-03-05 17:42:49 UTC
This afternoon (GMT-3), I've downloaded and installed a fresh NB 7.1 FCS and executed exactly same steps, and it is working fine (debugger is able to stop at correct jsp file even debugging two web apps at same time). Seems to me it is a regression as per 7.1 FCS.

I can't tell about 7.2.x family because it has so many bugs we could not even start using it. We are now jumping from 7.1 to 7.3.


Regards,

Edson
Comment 8 ecerichter 2013-03-05 17:46:48 UTC
(In reply to comment #7)
> This afternoon (GMT-3), I've downloaded and installed a fresh NB 7.1 FCS and
> executed exactly same steps, and it is working fine (debugger is able to stop
> at correct jsp file even debugging two web apps at same time). Seems to me it
> is a regression as per 7.1 FCS.
> 
> I can't tell about 7.2.x family because it has so many bugs we could not even
> start using it. We are now jumping from 7.1 to 7.3.
> 
> 
> Regards,
> 
> Edson

Forget it, I'm wrong. It is not a regression. Is just a casuality it has never been catch in NetBeans 7.1. I can now reproduce same error in NB 7.1.

Kind regards,

Edson Richter
Comment 9 Petr Jiricka 2013-05-02 11:20:09 UTC
Based on the discussion with Martin Entlicher, since this is not a recent regression, we don't see it as a stopper for NetBeans 7.3.1. Adding the 731-not-a-stopper whiteboard.
Comment 10 Martin Entlicher 2013-09-01 15:51:59 UTC
Fixed by changeset:   262971:32504e4744c0
http://hg.netbeans.org/web-main/rev/32504e4744c0
Comment 11 Quality Engineering 2013-09-02 01:37:36 UTC
Integrated into 'main-silver', will be available in build *201309020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/32504e4744c0
User: mentlicher@netbeans.org
Log: #226908: Assure that we present source file from the proper context.