Bug 236324 - NetbeansRCP (maven) can't run if not enabled "compile on save"
NetbeansRCP (maven) can't run if not enabled "compile on save"
Status: VERIFIED FIXED
Product: apisupport
Classification: Unclassified
Component: Maven
7.4
PC Windows 7
: P2 (vote)
: 7.4
Assigned To: Milos Kleint
issues@apisupport
74patch1-verified
: PLATFORM
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-24 12:33 UTC by pramoth
Modified: 2013-11-22 12:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
IDE log (429.73 KB, text/plain)
2013-09-24 12:33 UTC, pramoth
Details
Minimal example project (18.50 KB, application/zip)
2013-10-09 15:33 UTC, hstenger
Details
IDE output from running minimal example (2.46 KB, text/plain)
2013-10-09 15:35 UTC, hstenger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pramoth 2013-09-24 12:33:26 UTC
Product Version = NetBeans IDE 7.4 RC1 (Build 201309162201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_40
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.0-b56

step to produce error.
1. open project from Netbeans 7.3.1
 2. clean + build
 3. run applition (RCP)
 then netbeans throw below exception

java.lang.AssertionError: At most one resource per module: StandardModule:th.co.geniustree.nhso.expatcard.expatcard.rcp.main jarFile: C:\Users\pramoth\Documents\NetBeansProjects\expatcard-rcp\application\target\expatcard_rcp\expatcard_rcp\modules\th-co-geniustree-nhso-expatcard-expatcard-rcp-main.jar
	at org.netbeans.core.startup.NbInstaller.loadLayers(NbInstaller.java:614)
	at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:356)
	at org.netbeans.core.startup.NbInstaller.access$000(NbInstaller.java:105)
	at org.netbeans.core.startup.NbInstaller$1.run(NbInstaller.java:346)
	at org.openide.filesystems.FileUtil$2.run(FileUtil.java:431)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:415)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:435)
	at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:343)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1186)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1009)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:340)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:301)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:181)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:150)
	at org.netbeans.core.startup.Main.start(Main.java:307)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:724)
Comment 1 pramoth 2013-09-24 12:33:39 UTC
Created attachment 140413 [details]
IDE log
Comment 2 hstenger 2013-10-09 15:32:04 UTC
I can reproduce this under Linux with 7.4 RC2. I found out it is the layer.xml file which triggers the AssertionError when the application loads a module from the jar file as well as the target/classes directory. The layer.xml file is then contained twice in the module.

I have created a minimal example to demonstrate this behaviour (see costest.zip). Steps to reproduce:
1. Open project in NetBeans IDE.
2. Use "Clean and Build" on costest-parent.
3. Modify a source file, e.g. add a line break in the layer.xml file in costest-core.
4. Use "Run" on costest-app.

Work-around: Disable Compile on Save on *all* dependent projects of the application.
Comment 3 hstenger 2013-10-09 15:33:55 UTC
Created attachment 140953 [details]
Minimal example project
Comment 4 hstenger 2013-10-09 15:35:44 UTC
Created attachment 140954 [details]
IDE output from running minimal example
Comment 5 Milos Kleint 2013-10-11 09:51:33 UTC
does upgrading the application to use netbeans 7.4 fix the problem?

I believe it should be enough to disable Compile on Save on the application project.
Comment 6 hstenger 2013-10-16 13:59:00 UTC
Upgrading the application to RELEASE74-BETA does not help. I cannot see RELEASE74 in the NetBeans repository yet.

Disabling Compile on Save for the application project was actually the first thing I tried. Sorry for not mentioning this earlier. However that does not seem to affect the behaviour at all.

Is there a way to disable Compile on Save globally? I searched in the options window and the menus but could not find anything.
Comment 7 Milos Kleint 2013-10-17 08:35:01 UTC
indeed, we were missing a check for CoS in the application project.
following changeset fixes that. Unfortunately for 7.4 FCS the only workaround is to either upgrade the platform to 7.4 (will be up shortly) or disable compile on save on all module projects.  That can be done globally by adding the <netbeans.compile.on.save>none</netbeans.compile.on.save> property to an activated profile in ~/.m2/settings.xml.

A likely candidate for a patch release backport.


http://bits.netbeans.org/nexus/content/repositories/release74
Comment 8 Tomas Danek 2013-11-05 14:47:58 UTC
Which changeset would you like to backport to 74patch1? 
I can confirm that changing to RELEASE74 fixes the problem that sample from comment #2 demonstrate in NetBeans 7.4 and Dev 20131104.
However without modifying to RELEASE74 this does not work.

(In reply to Milos Kleint from comment #7)
> indeed, we were missing a check for CoS in the application project.
> following changeset fixes that. Unfortunately for 7.4 FCS the only
> workaround is to either upgrade the platform to 7.4 (will be up shortly) or
> disable compile on save on all module projects.  That can be done globally
> by adding the <netbeans.compile.on.save>none</netbeans.compile.on.save>
> property to an activated profile in ~/.m2/settings.xml.
> 
> A likely candidate for a patch release backport.
> 
> 
> http://bits.netbeans.org/nexus/content/repositories/release74
Comment 9 Milos Kleint 2013-11-06 06:18:09 UTC
http://hg.netbeans.org/core-main/rev/e3fffe7e2aec

to be able to disable just CoS on the application. With CoS turned on the problem will still appear for some/many modules that work on top of pre 74 platform.
Comment 10 Tomas Danek 2013-11-06 08:42:02 UTC
ok thanks, verified in 

Product Version: NetBeans IDE Dev (Build 201311040001)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev
Comment 11 Milos Kleint 2013-11-13 10:50:57 UTC
http://hg.netbeans.org/releases/rev/6f779b0dbf8d
Comment 12 Tomas Danek 2013-11-22 12:54:06 UTC
verified in 
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.4
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.4


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo