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.
How to reproduce the bug: File|New Project|Samples|Servlet Stateless (Java EE6)|Finish In Projects window, project ServletStateless|Right click|Properties|Run Change from "GlassFish Server 3" to "GlassFish Server 3 1"|OK In StatelessSessionBean.java, Set a breakpoint on this line: return "Hello, " + name + "!\n"; In Services Window|Servers|GlassFish Server 3 1|Right click|Stop In Projects window, project ServletStateless|Right click|Debug The server starts and the home page displays in the browser. On the home page, enter your name and click the button. The NetBeans debugger stops on the breakpoint. Menu|Debug|Continue. In StatelessSessionBean.java, insert lines above the breakpoint: if(name != null){ throw new Error(); } Save StatelessSessionBean.java The breakpint jumps to the first line of code. The application is redeployed automatically. Set a breakpoint on every line of code. An error appears in the Debugger console. The console output so far is: Attaching to localhost:1121 User program running LineBreakpoint StatelessSessionBean.java : 39 successfully submitted. Breakpoint hit at line 39 in class servlet.stateless.StatelessSessionBean by thread http-thread-pool-8080-(2). Thread http-thread-pool-8080-(2) stopped at StatelessSessionBean.java:39. User program running Not able to submit breakpoint LineBreakpoint StatelessSessionBean.java : 40, reason: No executable location available at line 38 in class servlet.stateless.StatelessSessionBean. Invalid LineBreakpoint StatelessSessionBean.java : 40 LineBreakpoint StatelessSessionBean.java : 42 successfully submitted. In the browser window, repeat data entry as before. Expected behavior: The NetBeans debugger stops on the first breakpoint. Actual behavior: The NetBeans debugger skips the first breakpoint and stops on the last breakpoint. End of testcase. I found this behavior in more complex applications, but under the more generous condition after I stopped and re-started the debugging session to give the server a better chance for reloading. So far I do not yet have a testcase for the more generous condition. But I think that this testcase is very relevant because it reflects what developers actually do with the debugger, and I hope that a fix for it will solve many other cases.
The debugger does not know that the application was redeployed and therefore it calculates with shifted line numbers as if only the source file was modified.
Hi, I am running web applications deployed on GlassFish exclusively in debug mode to increase test coverage for NetBeans. This bug is one of what appears to me to be a limited number of bugs in the debugger. It would be nice to get a fix for this, or for bug 187501 with the next point release so that I can get a better handle on other bugs (testcases). Thanks.
Sorry, I was referring to bug 189744.
This happens also if I manually undeploy, re-build and re-deploy the application. Re-attaching the debugger does not work. So far the only fix I know is to re-start the server. I think this is priority one. The debugger should work without having to re-start the server. Please let's not forget the basics.
Well, for me it was enough to restart the debugger. I do not see a reason to restart the server. The debugger just needs to know that the application was redeployed. Task nbjpdaappreloaded was executed in this case in the past to re-submit breakpoints. Calling that task after redeploy should fix this.
Calling Deploy manually fixes the breakpoints correctly. It's just a problem of "Deploy on Save" mode.
*** Bug 167353 has been marked as a duplicate of this bug. ***
Martin I agree with all your statements. Sorry I confused the testcase with my projects where I am not getting away with manual deploy as in the testcase. I don't know why.
Martin, are you saying that when Deploy on Save is enabled and app is being debugged that nbjpdaappreloaded task should be called automatically as part of DoS? That make sense.
Yes, exactly. I haven't found the place where the nbjpdaappreloaded task should be called from... yet...
Fixed in changeset: 179112:b57d191cc590 http://hg.netbeans.org/main/rev/b57d191cc590
Thanks very much! This is fantastic.
Integrated into 'main-golden', will be available in build *201010090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b57d191cc590 User: mentlicher@netbeans.org Log: #187826 Correct the breakpoints and lines when program is deployed to the server.