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 208220 - Module system fails to load correctly when using Apache commons IO bundle module
Summary: Module system fails to load correctly when using Apache commons IO bundle module
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P2 normal with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 206826 207940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-09 21:56 UTC by ibeaumont
Modified: 2012-05-03 22:55 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test project that reproduces the problem. (9.79 MB, application/x-zip)
2012-02-09 22:01 UTC, ibeaumont
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ibeaumont 2012-02-09 21:56:27 UTC
On second and subsequent runs of an application the module system fails to initialise correctly when using the module "Apache commons IO bundle".  

To reproduce:
1. Create new "Netbeans platform application"
2. In the new suite properties add the library "Apache commons IO bundle" (in ide node).
3. Add a new module to the module suite.
4. In the new module, dset it having a dependency on "Apache commons IO bundle".
5. Create zip dist, and then unzip and run. (runs ok).
6. Exit, and run again and will get the following errors in the log.

This error seems to prevent certain other modules loading, as in my real application my “auto load” module doesn’t load after this error.

This has been reported in bug 207940 - but not in as much detail.
	
The cause of the problem seems to be what is written in to the var/cache/netigso-bundles file that is created.  The reference to org.apache.commons.io is completely different to all other references (which are blank).

INFO [org.netbeans.core.startup.ModuleList]
java.io.IOException: Cannot start org.apache.commons.io state remains INSTALLED after start()
	at org.netbeans.core.netigso.Netigso.createLoader(Netigso.java:295)
	at org.netbeans.NetigsoModule.start(NetigsoModule.java:150)
	at org.netbeans.NetigsoFramework.delayedInit(NetigsoFramework.java:212)
Caused: org.netbeans.InvalidException: Netigso: C:\Documents and Settings\ibeaumont\Desktop\suite2\suite2\ide\modules\org-apache-commons-io.jar: Cannot start org.apache.commons.io state remains INSTALLED after start()
	at org.netbeans.NetigsoFramework.delayedInit(NetigsoFramework.java:215)
	at org.netbeans.NetigsoFramework.turnOn(NetigsoFramework.java:185)
	at org.netbeans.ModuleManager.enable(ModuleManager.java:1071)
[catch] 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:294)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:172)
	at org.netbeans.core.startup.Main.start(Main.java:308)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:662)
WARNING [org.netbeans.core.modules]
java.lang.IllegalStateException: Module Netigso: C:\Documents and Settings\ibeaumont\Desktop\suite2\suite2\ide\modules\org-apache-commons-io.jar could not be installed but had no problems
	at org.netbeans.core.startup.NbProblemDisplayer.problemMessagesForModules(NbProblemDisplayer.java:231)
	at org.netbeans.core.startup.NbEvents.logged(NbEvents.java:188)
[catch] at org.netbeans.Events.log(Events.java:166)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:346)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:294)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:172)
	at org.netbeans.core.startup.Main.start(Main.java:308)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:662)

New project
   Netbeans platform Application

Add libraries
Apache commons IO bundle

Add a new module to it and then on the new module set it as having a dependency on “	Apache commons IO bundle”

Create zip dist.
Unzip and run app.
	Runs ok.
Now run again, check log and errors in it.  This error seems to prevent certain other modules loading, as in my real application my “auto load” module doesn’t load after this error.
Comment 1 ibeaumont 2012-02-09 22:01:02 UTC
Created attachment 115554 [details]
Test project that reproduces the problem.
Comment 2 Geertjan Wielenga 2012-02-09 22:04:11 UTC
What happens if, instead of including "Apache commons IO bundle" from the 
"ide" node, you create a library wrapper module that includes that JAR?
Comment 3 ibeaumont 2012-02-10 09:54:03 UTC
(In reply to comment #2)
> What happens if, instead of including "Apache commons IO bundle" from the 
> "ide" node, you create a library wrapper module that includes that JAR?

A wrapper works fine.  This is what I had before 7.1 (but I thought I would use the lib provided!).  Looks like I'll move back to my own wrapper.
Comment 4 jasondrums 2012-02-13 20:34:08 UTC
I'm just confirming that this is also occurring in our deployed software as well. It is unfortunate that the built in modules are not going to work out. I hope this issue gets some attention very soon as this causes undue configuration of wrapped libraries (apache commons io, lang, etc) when netbeans already provides it.
Comment 5 ibeaumont 2012-02-21 09:52:51 UTC
*** Bug 207940 has been marked as a duplicate of this bug. ***
Comment 6 Jaroslav Tulach 2012-02-24 11:26:07 UTC
Reproduced, second start really generates 
java.lang.IllegalStateException: Module Netigso: /home/jarda/tmp/x/app/ide/modules/org-apache-commons-io.jar could not be installed but had no problems
	at org.netbeans.core.startup.NbProblemDisplayer.problemMessagesForModules(NbProblemDisplayer.java:231)
	at org.netbeans.core.startup.NbEvents.logged(NbEvents.java:188)
[catch] at org.netbeans.Events.log(Events.java:166)
	at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:346)
	at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
	at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:294)
	at org.netbeans.core.startup.Main.getModuleSystem(Main.java:172)
	at org.netbeans.core.startup.Main.start(Main.java:308)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
	at java.lang.Thread.run(Thread.java:662)
Comment 7 Jaroslav Tulach 2012-02-24 13:31:05 UTC
ergonomics#c39cd53056ab
Comment 8 Jaroslav Tulach 2012-02-24 13:33:43 UTC
*** Bug 206826 has been marked as a duplicate of this bug. ***
Comment 9 Quality Engineering 2012-02-26 11:16:42 UTC
Integrated into 'main-golden', will be available in build *201202260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c39cd53056ab
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208220: Verify whether the bundle can be resolved before throwing an exception
Comment 10 philipwilkinson 2012-05-03 13:28:37 UTC
Any chance this could be applied to 7.1.2?