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 196944 - Debugger cannot submit breakpoint or steps on comments
Summary: Debugger cannot submit breakpoint or steps on comments
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-22 05:28 UTC by bht
Modified: 2011-04-05 08:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase (1.74 MB, application/zip)
2011-03-22 05:28 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2011-03-22 05:28:18 UTC
Created attachment 107173 [details]
Testcase

Product Version: NetBeans IDE Dev (Build 201103150400)
GlassFish Server Open Source Edition 3.1 (build 43)

If a debug session is started, and the application was deployed and has already run, then after a statement is added and saved with deploy on save, a  breakpoint cannot be submitted on it, or subsequent stepping steps on comments not statements.


How to reproduce:

- Start GlassFish in debug mode.
- Undeploy all applications
- Restart GlassFish
- Menu|Debug|Attach Debugger|Socket Attach
- Clean and build the attached application
- Deploy the application.

In class HomePage, in the constructor, insert the following line below line 5
        this.getSession().bind();
and save the class.

NetBeans deploys the class.

Set a breakpoint on the new line.

I get this error:

Attaching to tower:9009
User program running
Not able to submit breakpoint LineBreakpoint HomePage.java : 28, reason: No executable location available at line 27 in class page.HomePage.
Invalid LineBreakpoint HomePage.java : 28

Please note different line numbers 27 and 28.

Alternatively, I have seen another error after the breakpoint was set successfully:

In the services window, under GlassFish Server 3.1, refresh Applications
Right click on PanelReplacement, Open in Browser.
In the browser, click "Home"

After stepping over the breakpoint, the debugger would step on comments not on the next line of code.

In bug 189744, Martin Entlicher commented:
"Please note that the save does not recompile and upload the application to the
server. Therefore the breakpoint really can not be submitted ..."

Here I think that due to settings "Deploy on Save", "Compile on Save", this actually happens.

In my server properties, I have tried both settings on and off "Preserve Sessions Across Redeployment"
Comment 1 Martin Entlicher 2011-03-22 14:06:51 UTC
On Ubuntu this works without any problems.
I'll try on Windows Vista later...
Comment 2 bht 2011-03-23 19:12:45 UTC
Reproduces on Windows XP.

Reproduces with NetBeans 6.9.1 and GlassFish 3.1.

Does not reproduce with NetBeans 6.9.1 and GlassFish 3.01, so this appears to be GlassFish 3.1 related.
Comment 3 Petr Jiricka 2011-03-24 00:39:00 UTC
GlassFish 3.1 is not supported in NetBeans 6.9.1. How about GlassFish 3.0.1 with NetBeans 7.0 dev builds?
Comment 4 bht 2011-03-24 02:41:52 UTC
NetBEans 7 with  GlassFish 3.01
The problem is different. While it is possible to submit the breakpoint without an error (broken icon in gutter) at first,
the problem starts when I run the application (Services window|Server|GlassFish Server 3|Applications|PanelReplacement|Open in Browser
Attaching to tower:1334
User program running
Not able to submit breakpoint LineBreakpoint HomePage.java : 28, reason: No executable location available at line 27 in class page.HomePage.
Invalid LineBreakpoint HomePage.java : 28

So it looks it more NetBeans 7 related and not GlassFish 3.1 as I thought.
Comment 5 Marian Mirilovic 2011-03-25 23:30:15 UTC
keep it as candidate for 7.0 - need evaluation for stopper status
Comment 6 Martin Entlicher 2011-03-28 14:13:11 UTC
I've occasionally reproduced this on Ubuntu as well.
It looks like the map of shifted lines is not fully cleared when the app is deployed and therefore breakpoint lines are translated to the old line numbers (before the modification). This is why the line numbers differ.
Comment 7 Martin Entlicher 2011-04-01 13:07:37 UTC
Solving in J2EE, nbjpdaappreloaded ANT task needs to be executed after deploy to fix breakpoints.
Comment 8 Martin Entlicher 2011-04-04 13:49:12 UTC
Fixed by changeset:   191910:d213c65b9442
http://hg.netbeans.org/main/rev/d213c65b9442
Comment 9 Quality Engineering 2011-04-05 08:38:48 UTC
Integrated into 'main-golden', will be available in build *201104050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d213c65b9442
User: mentlicher@netbeans.org
Log: #196944 Run nbjpdaappreloaded ANT task after deploy.