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 207149 - Jsp, html, zul files are not updated when saved in Netbeans 7.1
Summary: Jsp, html, zul files are not updated when saved in Netbeans 7.1
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.1
Hardware: PC All
: P2 normal with 7 votes (vote)
Assignee: David Konecny
URL:
Keywords:
: 207201 207278 208231 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-11 00:39 UTC by arscek
Modified: 2012-10-15 18:51 UTC (History)
11 users (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 arscek 2012-01-11 00:39:36 UTC
Today I downloaded Netbeans 7.1 (Linux version running under Ubuntu 11.10). I have some web applications projects running on Tomcat6 and I noticed that when I made a change in a zul or jsp file, it wasn't updated on my browser when I hit F5, only if I redeploy the app. If I check the deploy on save or compile on save options, it does update those files, but this reloads the entire application, I lose my current session, and it redirects me to the start page and other undesirable behaviours I didn't have with previous versions of Netbeans (7.0.1, 6.9 etc). I tried reinstalling the IDE, and not importing from other versions (which I did the first time), with no luck.

This same thing happened to me in beta and RC versions, and I hoped this would be fixed by the final release, but I don't know if this is a new feature or if I am missing some configuration option(s) or if it is just a Bug.

Any help would be very appreciated. Thanks in advance!
Comment 1 David Konecny 2012-01-18 01:28:58 UTC
I'm not sure if this is server specific issue (Tomcat) or how this used to work in the past. PetrH?
Comment 2 arscek 2012-01-18 17:40:51 UTC
I've tried with tomcat 6 and 7, and also with Glassfish 3 with the same results. In previous versions of NB I just needed to save my web files(html, jsp, js, css) and then I could see the changes in my browser, even without having enabled the 'Compile on Save' or 'Deploy on Save' options, and now this is not working. When I use 'Compile on Save', my 'Apply Changes' button is disabled sometimes which I use very often when compiling, I think there's a bug filed for this.
Comment 3 David Konecny 2012-01-18 20:03:55 UTC
*** Bug 207201 has been marked as a duplicate of this bug. ***
Comment 4 David Konecny 2012-01-18 20:07:54 UTC
*** Bug 207278 has been marked as a duplicate of this bug. ***
Comment 5 David Konecny 2012-01-18 20:15:41 UTC
This does look like a regression. When Compile on Save is enabled and Deploy on Save disabled the files should be copied.
Comment 6 arscek 2012-01-18 20:22:45 UTC
Yes they are copied with compile on save, but that disables the 'Apply Changes' option when I'm debugging, and the changes made in classes are not visible when I save them unless I deploy the application again. So this leaves me in the same situation but now with the classes not being updated.
Comment 7 llturro 2012-01-19 09:51:42 UTC
With:

Compile on Save: checked
Deploy on Save: unchecked

Did not work. Files weren't copied.

After checking, unchecking and saving both options same configuration worked.

Conclusion: Netbeans 7.1 shows 'default' properties that aren't interpreted the same way when running. After modifying and saving those properties, they are saved 'correctly'.

Default behavior is a regression.
Comment 8 llturro 2012-01-19 09:53:50 UTC
Just in case: properties were from NB 7.0.1
Comment 9 nharrer 2012-01-26 13:23:31 UTC
Content from /web was automatically copied to /build/web up to Netbeans 7.0.1. Even when the 'Compile on Save' and 'Deploy on Save' options were not set.

This was extremely useful. Because the 'Compile on Save' option prevents the 'Apply Code Changes' feature. Redeploying causes the tomcat session to be kicked. Which means that one has to log into tomcat again and navigate to the point of interest for every small code change which could have been applied without all the trouble.

So hopefully the automatic copying from /web to /build/web will be enabled again regardless of the 'Compile on Save' option.
Comment 10 eolivelli 2012-03-02 19:39:16 UTC
I really need this feature to be restored in order to upgrade my team to nB7.1.

Is there anyone who developed a simple NBM to achieve the same result ?
thanks
Comment 11 Petr Hejl 2012-03-28 15:34:15 UTC
This has been introduced and is in a direct conflict with issue #200023 implemented by David.
Comment 12 David Konecny 2012-03-29 01:35:50 UTC
Thanks Petr. In issue 200023 user's usecase is exactly opposite to one presented here: if CompileOnSave is OFF then nothing should be copied. Which make sense to me. The fact that copying used to work even without CompileOnSave enabled was bug.

I tested the scenario (with Tomcat 7) with CompileOnSave enabled and DeployOnSave disabled and outcome is exactly the one requested by audience of this issue - files are copied and nothing is redeployed but changes in static files like HTML are seen by Tomcat.

I can confirm that Apply Changes action is disabled and I filed that as issue 210331. That's broken and must be fixed.

If DeployOnSave is disabled no redeployment to Tomcat happened and therefore Tomcat session was preserved.

In that regard, unless I missed something, this issue is WORKSFORME. Please confirm or state what else do you think is not working. Thanks.
Comment 13 nharrer 2012-03-29 11:20:45 UTC
Thanks David. But what if I'd like to have my jsp Files copied. Then I need to select DeployOnSave, which always implies CompileOnSave. But CompileOnSave always create a new class file which will kick the running tomcat sessions.

Wouldn't it be a solution to allow DeployOnSave enabled with CompileOnSave being disabled? That way it would copy all the files but not create new class files on save.
Comment 14 Petr Hejl 2012-03-29 13:45:21 UTC
(In reply to comment #13)
> Thanks David. But what if I'd like to have my jsp Files copied. Then I need to
> select DeployOnSave,
No you need just Compile on save.

> which always implies CompileOnSave. But CompileOnSave
> always create a new class file which will kick the running tomcat sessions.
Will it? Tomcat is not notified by the IDE about that. Is that because of reloadable attribute in your context.xml? Should be simple to test for you.

> Wouldn't it be a solution to allow DeployOnSave enabled with CompileOnSave
> being disabled? That way it would copy all the files but not create new class
> files on save.
Comment 15 tapehead 2012-03-29 14:23:44 UTC
One thing I have noticed is that if your project is using ANT builds the behavior has changed as described in this issue report.  However MAVEN projects still seem behave the way that they did in the past (pre 7.1).  Anyone else seeing this or am I wrong?
Comment 16 David Konecny 2012-03-29 20:35:31 UTC
(In reply to comment #14)
> > which always implies CompileOnSave. But CompileOnSave
> > always create a new class file which will kick the running tomcat sessions.
> Will it? Tomcat is not notified by the IDE about that. Is that because of
> reloadable attribute in your context.xml? Should be simple to test for you.

I had tested this myself before and my Tomcat session was preserved.

(In reply to comment #15)
> One thing I have noticed is that if your project is using ANT builds the
> behavior has changed as described in this issue report.  However MAVEN projects
> still seem behave the way that they did in the past (pre 7.1).

That sounds like problem was not fixed for Maven yet. Feel free to file an issue. Thanks.
Comment 17 ijakobs 2012-04-24 12:25:59 UTC
Please fix this, it's a real show stopper for us. It really makes NetBeans unusable, our team is stuck on 7.0.1.

I understand that it's not a 'bug', it's a 'feature', as you seem to have done it on purpose. Have you really thought about this thoroughly? "Compile on Save" should not affect how static html files are treated, updating them to web directory is not compiling.
Comment 18 eolivelli 2012-04-24 18:15:28 UTC
can you add other "flag" "copy static resources on save" ?
Comment 19 vassilievalex 2012-04-25 13:47:56 UTC
Please fix this, it's a real show stopper for us also
Comment 20 David Konecny 2012-04-26 00:02:50 UTC
> can you add other "flag" "copy static resources on save" ?

I had considered this but I saw no need for it. Perhaps "Compile On Save" is not the best name for this feature and causes more confusion than help here. But basically what happens is that files are copied from source directory to build directory. And in case of Java source files the compilation is involved. Could you help me to understand why there is a need to distinguish static resources from Java files and have ability to decide which one to copy. The only reason I've heard so far is from ijakobs (issue 200023) which says that 'Compile on Save' causes deletion of their class files. My first reaction is: file it as P1 and let's resolve it. What's the point of providing a feature (ie. "copy static resources on save" in this case) which only purpose is to workaround some other bugs. I would rather invest my time into fixing problems than providing workarounds for them.

Having said that I'm quite concerned that this prevents you guys from upgrading to newer NetBeans and would like to resolve this somehow for everybody for coming 7.2 release! So let's keep discussing this. If we could not resolve this in any other way adding "copy static resources on save" option is a fallback worst-case solution.
Comment 21 arscek 2012-04-26 04:07:26 UTC
I think the main problem here is that when you are debugging a jsp, jsf, zul, or whatever html based file, you lose all the information you may had in a form or a session if the 'Compile on Save' option is selected, and if you don't select that option, the changes are not applied unless you redeploy your application manually. That didn't happened before nb7.1, you just needed to reload your browser to see the changes (even just a simple tag or label), even if compile on save or deploy on save weren't checked.
Comment 22 David Konecny 2012-04-26 05:34:22 UTC
(In reply to comment #21)
> I think the main problem here is that when you are debugging a jsp, jsf, zul,
> or whatever html based file, you lose all the information you may had in a form
> or a session if the 'Compile on Save' option is selected,

This is not true. See my comment #12 - I tested it and Compile on Save does not affect your deployed application session unless you set Deploy on Save to true. See also Petr's comment #14 - "Is that because of reloadable attribute in your context.xml?" If this is really broken then, please, file an issue with steps to reproduce it and mention the number here and I will make sure it gets evaluated. Thanks.
Comment 23 ijakobs 2012-04-26 05:47:45 UTC
Thank you David for your answers. It seems that our team is not the only one who feels this issue is very critical.

>My first reaction is:
>file it as P1 and let's resolve it. What's the point of providing a feature
>(ie. "copy static resources on save" in this case) which only purpose is to
>workaround some other bugs. I would rather invest my time into fixing problems
>than providing workarounds for them.

I would have reacted the same way :) But anyways, that's not the only thing. What I tried to say was that I don't like that my class files compile automatically, I would rather have control over them. The 'apply code changes' button is enough for me. One reason I want to have control over when and what to compile is that java HotSpot can't always reload compiled classes while debugging, usually because of changed public interface of the class, but sometimes due to some unknown reason. If I have compiled the files myself, I know better when I have to restart tomcat.

But static files, they should always copy automatically. Speaking of workarounds: I tried (several times) the 'Compile on save' option as a workaround to the bug that html files were not copied..

"copy static resources on save": That would be a great idea! Could we please have that on the next version of NetBeans? Please!
Comment 24 David Konecny 2012-04-30 21:45:28 UTC
So you guys all vote on this issue and complain that things do not work but whenever I asked for a concrete reason why Compile on Save does not work for you or what's your Tomcat configuration, there was no reply. ijakobs being an exception. That's disappointing.

Anyway, NetBeans is getting close to 7.2 release and so I opted for a workaround and added "Copy Static Resources on Save" option to Compile panel. It will not get into 7.2 Beta but will be in final 7.2 release. I would appreciate if anybody could download a dev build of 7.2 in next day or two and test this and confirm it solved all your problems. Thanks.

9ef74489f9e2
Comment 25 Quality Engineering 2012-05-02 10:04:57 UTC
Integrated into 'main-golden', will be available in build *201205020400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9ef74489f9e2
User: David Konecny <dkonecny@netbeans.org>
Log: #207149 - Jsp, html, zul files are not updated when saved in Netbeans 7.1
Comment 26 ijakobs 2012-05-02 10:38:26 UTC
I will try it, as soon as it becomes available.
Comment 27 ijakobs 2012-05-03 06:50:44 UTC
It works great! Thank you David!

By the way, is there any estimation when the final version of 7.2 will be released?
Comment 28 Petr Jiricka 2012-05-03 07:58:47 UTC
Here is the schedule: http://wiki.netbeans.org/NetBeans_72

I.e. the first release candidate is currently planned for early June (shortly after code freeze), and then we will see how many RCs we will need and how long they will take.
Comment 29 David Konecny 2012-05-03 09:05:01 UTC
Any chances Petr of transplanting this into 7.2 Beta still?
Comment 30 Petr Jiricka 2012-05-03 13:28:36 UTC
Transplanted to beta branch: http://hg.netbeans.org/releases/rev/73677f1acd1f. Jirko, could you please verify?
Comment 31 David Konecny 2012-05-03 19:55:56 UTC
Thanks Petr.

The fix of this issue will be available in 7.2Beta release which will be out soon.
Comment 32 Quality Engineering 2012-05-04 03:03:19 UTC
Integrated into 'releases', will be available in build *201205031832* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/73677f1acd1f
User: David Konecny <dkonecny@netbeans.org>
Log: #207149 - Jsp, html, zul files are not updated when saved in Netbeans 7.1
Comment 33 Jiri Skrivanek 2012-05-04 06:49:31 UTC
Verified in trunk and NetBeans IDE 7.2 Beta (Build 201205031832). One question. With combination

Copy Static Resources on Save - false
Compile on Save - true
Deploy on Save - true

it doesn't deploy project on save. Is it expected behaviour? I assume not. It should not allow to deselect Copy Static when Deploy on Save is selected.
Comment 34 David Konecny 2012-05-11 00:33:27 UTC
(In reply to comment #33)
> It should not allow to deselect Copy Static when Deploy on Save is selected.

I agree.  Could you file an issue please? Thx.
Comment 35 David Konecny 2012-05-11 00:45:15 UTC
One correction:

(In reply to comment #33)
> Verified in trunk and NetBeans IDE 7.2 Beta (Build 201205031832). One question.
> With combination
> 
> Copy Static Resources on Save - false
> Compile on Save - true
> Deploy on Save - true
> 
> it doesn't deploy project on save.

What exactly happens is that modification of static files are ignored - any changes to them are not copied to build folder and redeployed. Changes to Java files should still result into compilation and redeployment of newer class files. Practically speaking I see no value in a feature like this though and agree with you that enabling "Deploy on Save" should always enabled both CSRoS and CoS.
Comment 36 Jiri Skrivanek 2012-05-11 09:55:48 UTC
Filed bug 212370.
Comment 37 Quality Engineering 2012-05-11 10:10:28 UTC
Integrated into 'main-golden', will be available in build *201205110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d3f88ef17717
User: kganfield <kganfield@netbeans.org>
Log: #207149, draft of update for Copy Static Resources on Save option in Properties window. Still not clear about behavior
Comment 38 Quality Engineering 2012-05-12 09:58:39 UTC
Integrated into 'main-golden', will be available in build *201205120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ba8755b7da70
User: kganfield <kganfield@netbeans.org>
Log: #207149, update topics to incorporate feedback
Comment 39 Quality Engineering 2012-10-10 07:34:44 UTC
Integrated into 'releases', will be available in build *201210100002* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/73677f1acd1f
User: David Konecny <dkonecny@netbeans.org>
Log: #207149 - Jsp, html, zul files are not updated when saved in Netbeans 7.1
Comment 40 David Konecny 2012-10-15 18:51:07 UTC
*** Bug 208231 has been marked as a duplicate of this bug. ***