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 206365 - NetigsoModule.getDependenciesArray() does not contain anything useful
Summary: NetigsoModule.getDependenciesArray() does not contain anything useful
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P1 normal with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 209201 209944 209977 (view as bug list)
Depends on: 201695
Blocks: 201612
  Show dependency tree
 
Reported: 2011-12-14 10:55 UTC by KhArtNJava
Modified: 2012-11-06 10:40 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error log messages.log (20.31 KB, application/octet-stream)
2011-12-14 10:55 UTC, KhArtNJava
Details
messages.log with the new lines (23.53 KB, application/octet-stream)
2011-12-14 11:01 UTC, KhArtNJava
Details
Prevent uninstalling OSGi bundles (1.09 KB, patch)
2012-02-29 15:36 UTC, Jaroslav Tulach
Details | Diff
a proposed patch (1.97 KB, patch)
2012-04-11 21:42 UTC, Jiri Rechtacek
Details | Diff
getDependenciesArray() returns something sort of useful (7.61 KB, patch)
2012-04-16 15:36 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description KhArtNJava 2011-12-14 10:55:58 UTC
Created attachment 114148 [details]
Error log messages.log

This exception showed after removing plugin http://plugins.netbeans.org/plugin/585
and restarting IDE.
Comment 1 KhArtNJava 2011-12-14 11:00:28 UTC
Now IDE can't start normaly... After starting IDE shows dialog with the error's text, what I store in "Error log messages.log" and when I try to close IDE's window, IDE appended to messages.log new lines "java.lang.AssertionError: RootsListeners are already dormant...".
Now I will put full version of the messages.log with the new lines.
Comment 2 KhArtNJava 2011-12-14 11:01:05 UTC
Created attachment 114150 [details]
messages.log with the new lines

messages.log with the new lines
Comment 3 Jaroslav Tulach 2011-12-15 09:58:19 UTC
Search your installation and userdir for for org.apache.commons.lang JARs please:

org.osgi.framework.BundleException: The bundle "org.eclipse.mylyn.commons.net_3.6.0.v20110608-1400 [80]" could not be resolved. Reason: Missing Constraint: Require-Bundle: org.apache.commons.lang; bundle-version="2.3.0"
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
Comment 4 KhArtNJava 2011-12-15 10:53:00 UTC
I've now deleted the module and again the error occurred.
In the userdir I have only 2 jars
modules/docs/org-netbeans-modules-autosave.jar
modules/org-netbeans-modules-autosave.jar
Files with org.apache.commons.lang not founded.
As I understand, 
Included with rbremner-tocase.nbm supplied file org-apache-commons-lang.nbm. When I tried to install org-apache-commons-lang.nbm IDE reports that the module is installed, which is confirmed the existence of a JAR file in the folder where you installed NetBeans. As I understand it, if you remove the module ToCase IDE attempts to remove the JAR file containing the JAR org.apache.commons.lang and removes the file not from userfolder, but from the directory you installed IDE.
That generally disrupts the IDE.
Comment 5 Tomas Stupka 2011-12-20 10:53:02 UTC
the mentioned plugin comes with two nbm-s
- rbremmer-tocase.nbm
- org.apache.commons.lang.nbm
where the first declares a dependency on apache.commons.lang
OpenIDE-Module-Module-Dependencies="org.apache.commons.lang > 1.0, org.openide.nodes > 6.7.1, org.openide.text > 6.9.1, org.openide.util > 6.8.1" 

what happens during uninstall of rbremmer-tocase is that ModuleManager.getModuleInterdependencies(...) is called, and the guess is that this returns rbremmer-tocase as the only one depending on org.apache.commons.lang even if there are still some osgi bundles (e.g. org.eclipse.mylyn.commons.net) which Require-Bundle: org.apache.commons.lang

reassigning for further evaluation
Comment 6 Jaroslav Tulach 2012-01-02 17:48:07 UTC
Probably more related to autoupdate, than module system. The module system only partially understands OSGi dependencies and leaves most of the work on OSGi runtime itself.
Comment 7 Jiri Rechtacek 2012-01-03 09:36:30 UTC
(In reply to comment #6)
> Probably more related to autoupdate, than module system. The module system only
> partially understands OSGi dependencies and leaves most of the work on OSGi
Cannot agree, AU uses Module System API and expect a correct answer. Module System can delegate it to OSGi runtime instead of adding new job for AU itself. IMHO it's a regression in noted method.
 
> runtime itself.
Comment 8 Jaroslav Tulach 2012-02-29 15:36:04 UTC
Created attachment 116209 [details]
Prevent uninstalling OSGi bundles

This kind of fix seems more safe than changing the ModuleManager behavior.
Comment 9 KhArtNJava 2012-02-29 16:03:21 UTC
Hello.
I cant understend your fix variant.
What happens, if the system module, for example org.apache.co...., has been integrated in the other module, for example name.khartn.mymodule....., as in this situation and this 'hybrid' module has been installed? What happens, if I will delete 'hybrid' module? IDE will disallow uninstalling of the 'hybrid' module, because it is contain kit module, or IDE will delete 'hybrid' but at the same time will leave the desired kit module?
Comment 10 Jesse Glick 2012-02-29 19:45:34 UTC
Agreed with comment #7, this is something that must be fixed in the module system if we are to claim any kind of OSGi interoperability.
Comment 11 Jiri Rechtacek 2012-03-06 08:08:12 UTC
*** Bug 209201 has been marked as a duplicate of this bug. ***
Comment 12 Monomachus 2012-03-06 14:51:09 UTC
My plugin also used apache-commons-lang. But I felt that it will also install the jar itself and will be ok to uninstall it without the jar itself. How can I overcome this thing?
Comment 13 Jiri Rechtacek 2012-03-29 09:02:50 UTC
*** Bug 209944 has been marked as a duplicate of this bug. ***
Comment 14 Marian Mirilovic 2012-03-29 09:26:48 UTC
*** Bug 209977 has been marked as a duplicate of this bug. ***
Comment 15 Jiri Rechtacek 2012-04-11 21:42:28 UTC
Created attachment 118162 [details]
a proposed patch

Please review the attached patch which fixed this issue.
Comment 16 Jesse Glick 2012-04-12 02:21:03 UTC
It seems that Module.getDependenciesArray should be providing sensible information for bundles to begin with, right?
Comment 17 Jiri Rechtacek 2012-04-12 06:52:23 UTC
(In reply to comment #16)
> It seems that Module.getDependenciesArray should be providing sensible
> information for bundles to begin with, right?
Maybe. My patch finds more dependencies for bundles and returns the bundles dependents on them.
Comment 18 Jaroslav Tulach 2012-04-16 15:36:46 UTC
Created attachment 118352 [details]
getDependenciesArray() returns something sort of useful

OK, I am trying to modify NetigsoModule.getDependencies to return something sort of useful, but it is not easy. I cannot guarantee 100% correctness with OSGi specification. In cases OSGi and me interprets the dependencies differently, we may get into situation when the system refuses to start even the bundle OSGi dependencies would be OK.

To migitate that I tried to use "recommends" and not "requires". For import and export of packages it seems to work OK. However, it would help me to have implementation of issue 201695 - to be able to transfer Require-Bundle into recommends automatically as well.

Would autoupdate work OK with "recommends" - only?
Comment 19 Jiri Rechtacek 2012-04-16 16:37:56 UTC
(In reply to comment #18)
> Created attachment 118352 [details]
> getDependenciesArray() returns something sort of useful
[...]
> Would autoupdate work OK with "recommends" - only?
The patch solves the originally reported problem in AU. Thanks. However, when I run IDE including this patch with clean userdir, some modules (bugzilla) cannot be loaded. The same IDE w/o patch starts correctly.

Warning - could not install some modules:
	org.netbeans.modules.bugzilla - The module org.eclipse.mylyn.commons.net would also need to be installed.
	org.netbeans.modules.bugzilla - The module org.eclipse.mylyn.tasks.core would also need to be installed.
	org.netbeans.modules.bugzilla - The module org.eclipse.core.runtime would also need to be installed.
	org.netbeans.modules.bugzilla - The module org.eclipse.mylyn.bugzilla.core would also need to be installed.
	org.netbeans.modules.bugzilla.exceptionreporter - The module org.netbeans.modules.bugzilla would also need to be installed.
Comment 20 Jaroslav Tulach 2012-04-17 09:22:39 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > Created attachment 118352 [details]
> > getDependenciesArray() returns something sort of useful
> [...]
> > Would autoupdate work OK with "recommends" - only?
> The patch solves the originally reported problem in AU. 

Perfect. I'll polish the code and integrate then.

> be loaded. The same IDE w/o patch starts correctly.
> Warning - could not install some modules:
>     org.netbeans.modules.bugzilla - The module org.eclipse.mylyn.commons.net
> would also need to be installed.

True, I need the API change as described in bug 201695. This is the full patch which allows the IDE to start without problems:
http://netbeans.org/bugzilla/attachment.cgi?id=118354
Hopefully it also works for AU.
Comment 21 Jaroslav Tulach 2012-04-20 06:20:40 UTC
ergonomics#21aa64230b67
Comment 22 Quality Engineering 2012-04-26 10:31:01 UTC
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/21aa64230b67
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #201695: Implicitly provide code name base token. #206365: Mimic OSGi dependencies with recommends/provides