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 177230 - add compile on save features to maven EAR projects
Summary: add compile on save features to maven EAR projects
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P1 normal with 9 votes (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 157093 184922 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-19 11:04 UTC by bleathem
Modified: 2011-01-05 18:46 UTC (History)
9 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
simple test case (3.46 KB, application/x-gzip)
2010-11-26 22:50 UTC, kingsob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bleathem 2009-11-19 11:04:01 UTC
Compile and save features have been added to the IDE for maven projects (see Bug 148499)

However compile-on-save does not work for maven EAR projects.  Please extend the compile-on-save maven support to include EAR projects.
Comment 1 Milos Kleint 2009-11-20 07:30:15 UTC
one trick you might have misses is that in order to have CoS to kick in on the web in ear, both web and ear project need to have the CoS enables for main sources. Then it could work.
Comment 2 mikael 2009-11-23 03:20:10 UTC
I have CoS enabled for both ejb, web & ear, however it still does not work.
Comment 3 Antonin Nebuzelsky 2010-01-14 06:58:28 UTC
Changing the default owner to issues@javaee.
Comment 4 noz 2010-03-13 23:46:47 UTC
i have been waiting for this since NB V.6.7. It would be so great if it would work with 6.9.
I downloaded and tested it with 6.9M1, but it doesn't work.
Greetings
Daniel
Comment 5 noz 2010-04-24 08:22:31 UTC
I made some tests with the new beta version of Netbeans 6.9 but the CoS Ear Problem still exists.
Comment 6 Petr Jiricka 2010-04-28 08:31:34 UTC
*** Bug 184922 has been marked as a duplicate of this bug. ***
Comment 7 noz 2010-05-12 12:01:41 UTC
*** Bug 157093 has been marked as a duplicate of this bug. ***
Comment 8 noz 2010-05-23 12:52:28 UTC
any updates on this bug yet? will it be fixed for release 6.9?
Regards
Daniel
Comment 9 jbulck 2010-06-08 12:57:36 UTC
"Deploy on Save" convinced me to give Netbeans a try.  

Now, after 1 day of 'getting familiar' with this new environment, I discover this issue... 

Please fix this showstopper in 6.9!!  

Thank you!!
J.
Comment 10 jockeeriksson 2010-06-09 18:43:07 UTC
This is my very old school solution to this problem untill it gets fixed. Maybe it will help some poor soul that also waits for this issue.

#!/bin/bash

while [ 0 == 0 ]
do
  rsync -avz  /home/joe/trunk/voicemail-web/src/main/webapp/jsp /home/joe/trunk/voicemail-ear/target/gfdeploy/voicemail-web-1.0-SNAPSHOT_war/

  rsync -avz  /home/joe/trunk/voicemail-web/src/main/webapp/css /home/joe/trunk/voicemail-ear/target/gfdeploy/voicemail-web-1.0-SNAPSHOT_war/

  rsync -avz  /home/joe/trunk/voicemail-web/src/main/webapp/images /home/joe/trunk/voicemail-ear/target/gfdeploy/voicemail-web-1.0-SNAPSHOT_war/

  sleep 5
done
Comment 11 noz 2010-06-09 20:23:22 UTC
@jockeeriksson
thank you so much for sharing the information. I am really waiting for this 'enhancement' to be implemented. 
What about the latest status from any Netbeans developer, please?
Comment 12 Petr Jiricka 2010-06-15 08:54:35 UTC
> What about the latest status from any Netbeans developer, please?

We are evaluating this feature for the next release after NetBeans 6.9.
Comment 13 bleathem 2010-06-15 15:40:37 UTC
FWIW, I bought jRebel, and it fills this hole really nicely.  I do not work for ZeroTurnaround, I just found the product to be a good solution.

Brian
Comment 14 Milos Kleint 2010-06-15 15:51:19 UTC
re bleathem: yes, jrebel shall be significantly better as it's 
1. doesn't redeploy the application
2. shall be able to find *any* dependency of the ear just by the presence of the rebel.xml file in the built artifact and connect the correct project output folder to the binary on the app server.
Comment 15 noz 2010-06-15 16:43:37 UTC
Hi everyone,
I am pretty disappointed with the decision to implement it after 6.9.
Look, the first CoS request was in September 2008 (Description From  Milos Kleint   2008-09-26 16:00:04). 

:(
Comment 16 jyeary 2010-11-05 12:32:57 UTC
This has shown up on the nbj2ee mailing list again. Is there a status update on if this will be in 6.9.x, or 7?
Comment 17 jockeeriksson 2010-11-19 21:39:02 UTC
Just downloaded the latest netbeans 7.0 beta and no progress have bean made on this issue, I think it's a joke. Who will work on a project where the smallest change on a jsp or css forces you to rebuild and redeploy. I love Netbeans but come on using rsync is like being back in the 80's.
Comment 18 David Konecny 2010-11-21 20:22:21 UTC
I'm investigating this issue right now.
Comment 19 David Konecny 2010-11-23 22:48:38 UTC
Fixed in 02fb5a53ec6f. I'm testing it right now and will push it later this week.
Comment 20 bleathem 2010-11-23 23:07:16 UTC
I'm assuming this will work nicely with Bug 177230?  Namely that deploy on save / compile on save separation?
Comment 21 David Konecny 2010-11-23 23:28:56 UTC
(In reply to comment #20)
> I'm assuming this will work nicely with Bug 177230?  Namely that deploy on save
> / compile on save separation?

Yes! That one is in my local changelog as well.
Comment 22 kingsob 2010-11-24 21:43:47 UTC
is this fix in the new 7.0 Beta release at http://netbeans.org/community/releases/70/

I am very eager to test out this fix!
Comment 23 David Konecny 2010-11-24 21:56:06 UTC
(In reply to comment #22)
> is this fix in the new 7.0 Beta release at
> http://netbeans.org/community/releases/70/
> 
> I am very eager to test out this fix!

No, Beta was released couple of days ago and I just pushed the fix in to central repo. It will be in Beta2 and also available in nightly builds later this week.

I would appreciate early testing! That would allow me to resolve any problems which might be left there for Beta2.

I thoroughly tested it and everything seems to be working. My testing scenario was:
#1) create EAR Maven project with EJB and WEB projects
#2) enabled Compile on Save in WEB, EJB and EAR
#3) create an EJB in EJB module and a Servlet calling that EJB in WEB module
#4) deploy and test it does something
after this step I was able to modify Servlet or create a new one or modify EJB code and save it and just reload the page in browser. Also observing content of target/gfdeploy in my EAR project showed that any saved files was compiled if necessary and correctly copied there.
Comment 24 kingsob 2010-11-26 16:21:42 UTC
Just wanted to let you know, I am testing this out using the development build, and this is working wonderfully!!  I can finally convert my projects over to use Maven. Thank you so much!


Derek
Comment 25 kingsob 2010-11-26 21:09:07 UTC
I have noticed when I clean my project, it does not undeploy the application from glassfish.. and then on next build, I get errors and the only way to fix seems to be restarting glassfish.


Derek
Comment 26 kingsob 2010-11-26 22:26:13 UTC
also I can't get my managed beans to deploy on save (but the xhtml files work fine)

My project uses JSF 2.0 and CDI @Named beans


Derek
Comment 27 kingsob 2010-11-26 22:50:14 UTC
Created attachment 103394 [details]
simple test case

It looks like my previous comment was premature.  I am having problems getting anything to auto deploy now.. every once and a while I will get the JSF files to auto build on save, but most of the time it does not work.

I have attached my test project in case I have done something wrong.


Derek
Comment 28 David Konecny 2010-11-28 21:34:40 UTC
Thanks for testing Derek. I will have a look at your test case today.
Comment 29 David Konecny 2010-11-29 02:09:52 UTC
Derek, do you by a chance run GF 3.1 server? I tried your project on GF 3.1 and CDI just does not work for me - I filed it as GlassFish regression http://java.net/jira/browse/GLASSFISH-14842 If I use GF 3.0.1 instead everything works fine and I can change JSF page, your managed bean or EJB and after save change is propagated.
Comment 30 kingsob 2010-11-29 10:27:33 UTC
I am using Glassfish 3.0.1

I have done some more testing, and I can't replicate my problems. I have a feeling 1/2 way through my testing, I accidently switched back to 7.0 Beta1 (before these changes where implemented).

the only issue is that if I clean the project, it does not undeploy it from glassfish (like it would if this was not a maven project) but that is something I can easily live with.


Derek
Comment 31 David Konecny 2010-12-05 18:24:12 UTC
(In reply to comment #30)
> the only issue is that if I clean the project, it does not undeploy it from
> glassfish (like it would if this was not a maven project)

I filed it as separate issue 192895.
Comment 32 toni_braecksten 2010-12-28 08:41:28 UTC
I would like to re-open the issue, because there are still some problems with deployment for JBoss 5.x AS. I created a simple war project based on maven and configured the "DeployOnSave" stuff. When changing some JSP and/or Java files in the IDE, no update is propagated to the JBoss. 
For this test I used the Netbeans development built from 20101215 running on a Mac OS. The IDE log contains the following error messages.


INFO [org.netbeans.modules.j2ee.jboss4.JBDeployer]
java.lang.NoSuchMethodException: AOPProxy$2.load()
        at java.lang.Class.getDeclaredMethod(Class.java:1937)
        at org.netbeans.modules.j2ee.jboss4.JBoss5ProfileServiceProxy.isReady(JBoss5ProfileServiceProxy.java:104)
[catch] at org.netbeans.modules.j2ee.jboss4.JBDeployer.isApplicationReady(JBDeployer.java:330)
        at org.netbeans.modules.j2ee.jboss4.JBDeployer.waitForUrlReady(JBDeployer.java:283)
        at org.netbeans.modules.j2ee.jboss4.JBDeployer.run(JBDeployer.java:243)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
WARNING [org.openide.filesystems.Ordering]: Not all children in Loaders/text/x-ant+xml/Factories/ marked with the position attribute
: [org-apache-tools-ant-module-loader-AntProjectDataLoader.instance], but some are: [org.apache.tools.ant.module.resources.xml-ergonomics.instance]
WARNING [org.openide.awt.HtmlRenderer]: Malformed or unsupported HTML
WARNING [org.openide.awt.HtmlRenderer]:   <html><html><font&nbsp;color="#808080">&lt;Enter&nbsp;new&nbsp;watch&gt;</font></html></html>
WARNING [org.openide.awt.HtmlRenderer]:         ^
WARNING [org.openide.awt.HtmlRenderer]:  Full HTML string:<html><html><font&nbsp;color="#808080">&lt;Enter&nbsp;new&nbsp;watch&gt;</font></html></html>
WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no code name base passed when looking up docs/jstl11-doc.zip at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initHelp(JspSyntaxSupport.java:779)
WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no code name base passed when looking up docs/jsf12-tlddoc.zip at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initHelp(JspSyntaxSupport.java:808)
WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no code name base passed when looking up docs/struts-tags.zip at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initHelp(JspSyntaxSupport.java:821)
WARNING [org.netbeans.core.startup.InstalledFileLocatorImpl]: no code name base passed when looking up docs/syntaxref20.zip at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.initCompletionData(JspSyntaxSupport.java:918)
Comment 33 Petr Jiricka 2011-01-03 17:15:26 UTC
Hi, can you please file this as a separate report for the JBoss aspect against the serverplugins/JBoss category? If this works for other servers and not for JBoss, then this probably needs to be addressed on the JBoss plugin side, not on the side of the generic deployment infrastructure, or Maven projects. 

Also, I don't think this is supported for JBoss at this point, cc'ing Petr H to confirm.
Comment 34 David Konecny 2011-01-04 20:37:57 UTC
It does look like a separate JBoss plugin specific issue - please file a new one. Thanks.
Comment 35 toni_braecksten 2011-01-05 09:02:45 UTC
Thanks for update. I created a new ticket for the serverplugins/JBoss category. You can find this ticket at http://netbeans.org/bugzilla/show_bug.cgi?id=194038

Best regards
tb
Comment 36 toni_braecksten 2011-01-05 09:13:36 UTC
An additional question:
This ticket is set to resolved. Does this mean, that  no JBoss support is planned to deploy war/ear files on save via netbeans?

Best regards
tb
Comment 37 David Konecny 2011-01-05 18:46:58 UTC
(In reply to comment #36)
> This ticket is set to resolved. Does this mean, that  no JBoss support is
> planned to deploy war/ear files on save via netbeans?

No. This issue requested "compile-on-save does not work for maven EAR projects" and that request was implemented and was confirmed to work. Your problem with JBoss will be evaluated in separate issue 194038 which you filled.