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 186371 - [69cat] org.osgi.framework.BundleException: Unresolved constraint in bundle
Summary: [69cat] org.osgi.framework.BundleException: Unresolved constraint in bundle
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 10:21 UTC by abajja
Modified: 2010-06-26 14:08 UTC (History)
2 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 abajja 2010-05-19 10:21:16 UTC
[ BUILD # : 201005170932 ]
[ JDK VERSION : 1.6.20 ]

Test case
=========
1.- Create a suite
2.- Add an OSGi bundle M3 and a netbeans module M2 to the suite
3.- Import bundle by adding clusters (e.g. org.apache.felix.prefs,
org.apache.felix.log-1.0.0.jar)
4.- Add dependencies on the imported bundles for both M2 and M3
5.- Run in felix

start-output--------------------------------------------------------------------
--------------------
dependency org.apache.felix.log of module2 not found in batch; imports may not
be correct
dependency org.apache.felix.prefs of module2 not found in batch; imports may
not be correct
run-osgi:
suite-osgi.init:
suite-osgi.run:
No config.properties found.

Welcome to Felix
================

org.osgi.framework.BundleException: Unresolved constraint in bundle module2
[2]: module;
(&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-
version>=100.0.0)))
ERROR: Error starting
file:/C:/Projects/suite5/build/osgi/module2-1.0.0.100518.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle module2
[2]: module;
(&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-
version>=100.0.0))))
ERROR: Error starting file:/C:/Projects/suite5/build/osgi/module3-1.0.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle module3
[3]: module;
(&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-
version>=100.0.0))))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3295)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1653)
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1124)
        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
org.osgi.framework.BundleException: Unresolved constraint in bundle module3
[3]: module;
(&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-
version>=100.0.0)))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3295)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1653)
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1124)
        at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)

End-output----------------------------------------------------------------------
------------------

================================================================================
===================================
Note: If I copy these two libraries to /build/osgi, the error above desapears
and I get but still have these messages:
ependency org.apache.felix.log of module2 not found in batch ...
================================================================================
=====================================


Start-output--------------------------------------------------------------------
--------------------
dependency org.apache.felix.log of module2 not found in batch; imports may not
be correct
dependency org.apache.felix.prefs of module2 not found in batch; imports may
not be correct
run-osgi:
suite-osgi.init:
suite-osgi.run:
No config.properties found.

Welcome to Felix
================

19-may-2010 12:08:37 org.netbeans.core.TimableEventQueue done
End-output----------------------------------------------------------------------
------------------
Comment 1 abajja 2010-05-19 10:30:16 UTC
Edit note
Note: If I copy these two libraries to /build/osgi, the errors above disappear
but I still have these messages for the netbeans module (i.e not the osgi one):
dependency org.apache.felix.log of module2 not found in batch ...
dependency org.apache.felix.prefs of module2 not found in batch...
Comment 2 Jesse Glick 2010-05-20 19:01:04 UTC
Built those two bundles from source:

-rw-r--r--  1 jglick jglick 22199 2010-05-20 14:30 org.apache.felix.log-1.1.0-SNAPSHOT.jar
-rw-r--r--  1 jglick jglick 42477 2010-05-20 14:42 org.apache.felix.prefs-1.0.5-SNAPSHOT.jar

Will try to reproduce on Monday.
Comment 3 Jesse Glick 2010-05-24 20:33:04 UTC
Reproduced; the bundles from the external cluster are supposed to be scanned and copied but are not.
Comment 4 Jesse Glick 2010-05-24 20:45:50 UTC
core-main #1a6628dbff48
Comment 5 Quality Engineering 2010-05-26 07:20:30 UTC
Integrated into 'main-golden', will be available in build *201005260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1a6628dbff48
User: Jesse Glick <jglick@netbeans.org>
Log: #186371: [69cat] org.osgi.framework.BundleException: Unresolved constraint in bundle
Comment 6 rbalada 2010-06-23 22:30:35 UTC
Please verify bugfix for this bug ASAP, so it can be integrated into release691
repository.

Thanks,
-R
Comment 7 rbalada 2010-06-25 06:16:29 UTC
Last chance for inclusion in release691.

Please verify within 4 hours from now, since I have got limited time to transplant remaining bugfixes into release691 repository. June 25, 1 PM Prague time is my deadline. After that time, please do also the transplant/porting work if you want to include it.

Thank you for understanding,
-R
Comment 8 Jesse Glick 2010-06-25 15:38:37 UTC
No one to verify fix.

Untested workaround: first (i.e. before step #3 in comment #0) put all bundles into a "modules" subdirectory, then add the parent of this directory as your external cluster.
Comment 9 abajja 2010-06-25 16:02:26 UTC
(In reply to comment #8)
> No one to verify fix.
> 
I can help but I'm confused as I don't know which build is RC691.
Comment 10 Jesse Glick 2010-06-25 16:30:20 UTC
The fix is not yet in 6.9.1 builds (if they are even being produced); the point is that it is a _candidate_ for backporting to 6.9.1. To verify (RESOLVED/VERIFIED) would be to confirm that

1. The bug can be reproduced in 6.9.

2. The bug cannot be reproduced in a daily development build: http://bits.netbeans.org/download/trunk/nightly/latest/
Comment 11 abajja 2010-06-25 18:27:01 UTC
> 1. The bug can be reproduced in 6.9.
see bug #188100 (probably must be closed)


> 2. The bug cannot be reproduced in a daily development build:
> http://bits.netbeans.org/download/trunk/nightly/latest/

Works fine but when closing the applictaion (suite5), I get :


ERROR: JarContent: Unable to read bytes. (java.lang.IllegalStateException: zip file closed)
ADVERTENCIA: No such icon from org.netbeans.modules.profiler.actions.HeapDumpAction: org/netbeans/modules/profiler/actions/resources/dumpHeap.png
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:403)
        at java.util.zip.ZipFile.getEntry(ZipFile.java:148)
        at java.util.jar.JarFile.getEntry(JarFile.java:208)
        at org.apache.felix.framework.util.JarFileX.getEntry(JarFileX.java:61)
        at org.apache.felix.framework.cache.JarContent.getEntryAsBytes(JarContent.java:120)
        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1746)
        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:723)
Comment 12 abajja 2010-06-25 18:40:28 UTC
Product Version: NetBeans IDE Dev (Build 201006250001)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
Comment 13 Jesse Glick 2010-06-25 18:48:40 UTC
(In reply to comment #11)
>> 1. The bug can be reproduced in 6.9.
> see bug #188100 (probably must be closed)

Again, set the suite to be an app, and agree to exclude non-platform clusters.

> java.lang.IllegalStateException: zip file closed
>         at java.util.zip.ZipFile.ensureOpen(ZipFile.java:403)
>         at java.util.zip.ZipFile.getEntry(ZipFile.java:148)
>         at java.util.jar.JarFile.getEntry(JarFile.java:208)
>         at org.apache.felix.framework.util.JarFileX.getEntry(JarFileX.java:61)

See FELIX-2128 as mentioned in

http://wiki.netbeans.org/NetBeansInOSGi#What_Probably_Cannot_be_Made_to_Work
Comment 14 abajja 2010-06-26 08:34:57 UTC
 
> 1. The bug can be reproduced in 6.9.
confirmed:
A)The bundles org.apache.felix.prefs-1.0.4.jar, org.apache.felix.log-1.0.0.jar, 
are _NOT_ copied to the build/osgi directory

and, 

B)start_output__________________________________________________

Created dir: C:\Projects\suite5\build\osgi-cache

Welcome to Felix
No config.properties found.
================

ERROR: Error starting file:/C:/Projects/suite5/build/osgi/module2-1.0.0.100626.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle module2 [1]: module; (&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-version>=100.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle module2 [1]: module; (&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-version>=100.0.0)))
ERROR: Error starting file:/C:/Projects/suite5/build/osgi/module3-1.0.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle module3 [2]: module; (&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-version>=100.0.0))))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3295)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1653)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1124)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
org.osgi.framework.BundleException: Unresolved constraint in bundle module3 [2]: module; (&(bundle-symbolic-name=org.apache.felix.prefs)(bundle-version>=1.0.4)(!(bundle-version>=100.0.0)))
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3295)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1653)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1124)
        at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
26-jun-2010 10:11:43 org.netbeans.core.ui.warmup.DiagnosticTask run
INFO: Diagnostic information
Input arguments:
        -ea
        -Dbranding.token=suite5
        -Dfelix.auto.deploy.action=uninstall,install,update,start
        -Dfelix.log.level=3
        -Dorg.osgi.service.http.port=8080
        -Dobr.repository.url=http://felix.apache.org/obr/releases.xml
Compiler: HotSpot Client Compiler
Heap memory usage: initial 16,0MB maximum 247,5MB
Non heap memory usage: initial 34,2MB maximum 118,0MB
Garbage collector: Copy (Collections=32 Total time spent=0s)
Garbage collector: MarkSweepCompact (Collections=0 Total time spent=0s)
Classes: loaded=3188 total loaded=3188 unloaded 0

26-jun-2010 10:11:43 org.netbeans.core.ui.warmup.DiagnosticTask logEnv
INFO: Total memory 2.137.075.712
26-jun-2010 10:11:43 org.netbeans.core.ui.warmup.DiagnosticTask logEnv
INFO: Total physical memory 2.137.075.712
26-jun-2010 10:11:44 org.openide.filesystems.Ordering getOrder
ADVERTENCIA: Not all children in Menu/Help/ marked with the position attribute: [master-help.xml], but some are: [Separator1.instance, org-netbeans-core-actions-AboutAction.shadow]

end_output____________________________________________________

 
> 2. The bug cannot be reproduced in a daily development build:

confirmed:

A)The bundles org.apache.felix.prefs-1.0.4.jar, org.apache.felix.log-1.0.0.jar, 
are copied to the build/osgi directory

and, 

B)start_output__________________________________________________
Created dir: C:\Projects\suite5\build\osgi-cache
No config.properties found.

Welcome to Felix
================

Start: Hola
26-jun-2010 10:21:03 org.netbeans.core.ui.warmup.DiagnosticTask run
INFO: Diagnostic information
Input arguments:
        -ea
        -Dbranding.token=suite5
        -Dfelix.auto.deploy.action=uninstall,install,update,start
        -Dfelix.log.level=3
        -Dorg.osgi.service.http.port=8080
        -Dobr.repository.url=http://felix.apache.org/obr/releases.xml
Compiler: HotSpot Client Compiler
Heap memory usage: initial 16,0MB maximum 247,5MB
Non heap memory usage: initial 34,2MB maximum 118,0MB
Garbage collector: Copy (Collections=32 Total time spent=0s)
Garbage collector: MarkSweepCompact (Collections=0 Total time spent=0s)
Classes: loaded=3202 total loaded=3202 unloaded 0

26-jun-2010 10:21:03 org.netbeans.core.ui.warmup.DiagnosticTask logEnv
INFO: Total memory 2.137.075.712
26-jun-2010 10:21:03 org.netbeans.core.ui.warmup.DiagnosticTask logEnv
INFO: Total physical memory 2.137.075.712
26-jun-2010 10:21:03 org.openide.filesystems.Ordering getOrder
ADVERTENCIA: Not all children in Menu/Help/ marked with the position attribute: [master-help.xml], but some are: [Separator1.instance, org-netbeans-core-actions-AboutAction.shadow]
End: Adiós
BUILD SUCCESSFUL (total time: 30 seconds)
end_output____________________________________________________
Comment 15 rbalada 2010-06-26 11:20:39 UTC
abajja,

does this mean that you verified the bug has been fixed in trunk/development daily builds?
Comment 16 abajja 2010-06-26 12:05:35 UTC
(In reply to comment #15)
> abajja,
> 
> does this mean that you verified the bug has been fixed in trunk/development
> daily builds?

Yes. (Build 201006250001).
Comment 17 rbalada 2010-06-26 14:08:36 UTC
Marking VERIFIED as per comment #14 - #16

main #1a6628dbff48 transplanted to release691 #eeb45c12d1bc