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 197106 - Debug Code Changes not applied on save
Summary: Debug Code Changes not applied on save
Status: RESOLVED DUPLICATE of bug 197067
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 22:33 UTC by bht
Modified: 2011-04-06 09:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2011-03-25 22:33:33 UTC
How to reproduce:

- Check the following option:
Menu|Tools|Options|Miscellaneous|Java Debugger|Apply code changes after save (in "Compile on Save" mode only)

- Menu|File|New Project|Samples|Java Web|Servlet Stateless(Java EE 6)|Next|
- Projects Window|ServletStateless|Properties|Compiling|Compile on Save: on
- Projects Window|ServletStateless|Properties|Run|Deploy on Save: off
- Projects Window|ServletStateless|Properties|Run|Server|GlassFish Server 3.1
- Projects Window|ServletStateless|Debug

- Change code in  StatelessSessionBean.java and save, watching IDE status bar at bottom of screen.

Expected result: code changes should be applied (debug-fix)
Actual result: code changes are not applied.
Comment 1 bht 2011-03-25 22:34:11 UTC
Product Version: NetBeans IDE Dev (Build 201103150400)
Java: 1.6.0_22; Java HotSpot(TM) Client VM 17.1-b03
System: Windows 2000 version 5.0 running on x86; Cp1252; en_NZ (nb)
Comment 2 bht 2011-03-28 07:30:02 UTC
Changed to priority 2 - trying to help. I think this is quite critical for smooth development.
Comment 3 Martin Entlicher 2011-03-28 12:03:30 UTC
I've reproduced the problem. As a workaround, Deploy on Save can be turned on.
Comment 4 bht 2011-03-30 23:25:00 UTC
Sometimes it works. When it worked, I found another problem which I cannot make a testcase for before this is fixed:

- Make an incompatible change eg add method and let IDE complain
- deploy the app
- make a compatible change eg add line to method

The IDE complains as before that the change is incompatible. It should not do this because the app has since been re-deployed.
Comment 5 Martin Entlicher 2011-04-05 16:31:18 UTC
It looks like the "Compile on Save" mode does not work for the Servlet project.
When I do a modification and save the file, the appropriate class files does not change.
Also, I did not find a debugger snippet XML file that starts the debugger on the web project. Java projects define var/cache/executor-snippets/debug.xml that starts debugger in Compile on Save mode and defines listeningcp property that is used to listen on changes of build artifacts. I did not find anything like that in the Servlet Stateless project.

There's no problem in code changes application on save in standard Java projects.

Therefore moving to web project for evaluation...
Comment 6 Martin Entlicher 2011-04-05 16:33:01 UTC
As for the "change is incompatible" problem - this is out of scope for NetBeans. Code changes are applied by the debugger backend that is in JVM. Therefore this is a job of JVM.
Comment 7 David Konecny 2011-04-05 21:18:50 UTC
(In reply to comment #5)
> It looks like the "Compile on Save" mode does not work for the Servlet project.
> When I do a modification and save the file, the appropriate class files does
> not change.

This has been just fixed as issue 197067.

> Also, I did not find a debugger snippet XML file that starts the debugger on
> the web project. Java projects define var/cache/executor-snippets/debug.xml
> that starts debugger in Compile on Save mode and defines listeningcp property
> that is used to listen on changes of build artifacts. I did not find anything
> like that in the Servlet Stateless project.

Java projects runs app locally but in Web App case it is application server which runs in debug mode and to which the IDE attached. Correctly me if I'm wrong please.

For now I'm closing as duplicate of issue 197067. Please reopen if I missed something.

*** This bug has been marked as a duplicate of bug 197067 ***
Comment 8 bht 2011-04-05 22:28:36 UTC
Without having tested anything, I am challenging the practice of closing issues by cross-referencing each other and marking them duplicates in a circular manner without actually making any changes to either of them :)
Comment 9 David Konecny 2011-04-05 22:50:48 UTC
(In reply to comment #8)
> Without having tested anything, I am challenging the practice of closing issues
> by cross-referencing each other and marking them duplicates in a circular
> manner without actually making any changes to either of them :)

In general terms I agree with you but not in this instance. Martin said that "Compile on Save" is not working and turning "Deploy on Save" fixes it. And that's exactly the problem which was addressed in issue 197067. In addition both of the issues were filed by single originator (that is you!) which further assures me that it is very likely the same problem. I would appreciate if you could retest it and reopen the issue if it does not work. Now let me look at dozens of other issues I have to have a look at. :-)

*** This bug has been marked as a duplicate of bug 197067 ***
Comment 10 bht 2011-04-06 09:48:33 UTC
My apologies - I overlooked that there is a patch pending in issue 197067.