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.
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"
On Ubuntu this works without any problems. I'll try on Windows Vista later...
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.
GlassFish 3.1 is not supported in NetBeans 6.9.1. How about GlassFish 3.0.1 with NetBeans 7.0 dev builds?
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.
keep it as candidate for 7.0 - need evaluation for stopper status
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.
Solving in J2EE, nbjpdaappreloaded ANT task needs to be executed after deploy to fix breakpoints.
Fixed by changeset: 191910:d213c65b9442 http://hg.netbeans.org/main/rev/d213c65b9442
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.