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 210325 - NetBeansInOSGi refresh
Summary: NetBeansInOSGi refresh
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Jesse Glick
URL: http://wiki.netbeans.org/NetBeansInOSGi
Keywords:
Depends on: 211614 211611 211809 213786
Blocks:
  Show dependency tree
 
Reported: 2012-03-28 21:28 UTC by Jesse Glick
Modified: 2012-06-09 04:33 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 Jesse Glick 2012-03-28 21:28:24 UTC
Need to retest NetBeansInOSGi for 7.2, particularly with new Felix 4.

Can try mapping NB's require/need/recommend/provide tokens to OSGi require/provided-capabilities.

core.osgi unit tests seem to be failing; need to be cleaned up and put in core-main.
Comment 1 Jesse Glick 2012-04-03 13:39:59 UTC
Also need to implement @OnStart/@OnStop.
Comment 2 Jesse Glick 2012-04-21 02:22:06 UTC
Tests now passing at least.
Comment 3 Quality Engineering 2012-04-22 09:50:04 UTC
Integrated into 'main-golden', will be available in build *201204220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a5089c545361
User: Jesse Glick <jglick@netbeans.org>
Log: #210325: run core.osgi tests, now that they pass again.
Comment 4 Jesse Glick 2012-04-23 23:26:00 UTC
(In reply to comment #1)
> Also need to implement @OnStart/@OnStop.

core-main #03f4c193b99b
Comment 5 Jesse Glick 2012-04-24 02:59:25 UTC
Did a variety of fixes. Outstanding known problems:


1. Mylyn bundles do not get loaded (thus no issue tracking etc.):

java.lang.ClassCastException: org.eclipse.core.internal.net.Activator cannot be cast to org.osgi.framework.BundleActivator
	at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4177)


2. masterfs.windows is apparently loaded even on Unix, despite having an appropriate require token:

Apr 23, 2012 10:41:07 PM org.openide.util.lookup.MetaInfServicesLookup$P getInstance
WARNING: Cannot create class org.netbeans.modules.masterfs.watcher.windows.WindowsNotifier
java.lang.UnsatisfiedLinkError: Unable to load library 'kernel32': libkernel32.so: cannot open shared object file: No such file or directory
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:169)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:242)
	at com.sun.jna.Library$Handler.<init>(Library.java:140)
	at com.sun.jna.Native.loadLibrary(Native.java:368)
	at org.netbeans.modules.masterfs.watcher.windows.WindowsNotifier.<clinit>(WindowsNotifier.java:235)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
	at java.lang.Class.newInstance0(Class.java:372)
	at java.lang.Class.newInstance(Class.java:325)
	at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64)
	at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:519)
	at org.netbeans.modules.masterfs.watcher.Watcher.getNotifierForPlatform(Watcher.java:414)
	at org.netbeans.modules.masterfs.watcher.Watcher.<init>(Watcher.java:85)


3. Some linkage problem with org.w3c.dom.traversal, at least on JDK 7, prevents most usages of JAXP (including running Ant builds):


java.lang.ClassNotFoundException: org.w3c.dom.traversal.DocumentTraversal not found by org.netbeans.libs.xerces [94]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 75 more
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/w3c/dom/traversal/DocumentTraversal
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)


4. nbinst://org.apache.commons.logging/modules/org-apache-commons-logging.jar and the like unresolved (e.g. in Classpath for Hibernate JPA library).
Comment 6 Jaroslav Tulach 2012-04-24 03:42:21 UTC
Re. #1: Mylyn requires Equinox, can't run in Felix
Comment 7 Quality Engineering 2012-04-25 09:58:21 UTC
Integrated into 'main-golden', will be available in build *201204250400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/03f4c193b99b
User: Jesse Glick <jglick@netbeans.org>
Log: #210325: @OnStart/Stop handling.
Comment 8 Jesse Glick 2012-04-26 21:45:47 UTC
5. Need to write test for LayerProvider.
Comment 9 Jesse Glick 2012-04-26 22:48:23 UTC
(In reply to comment #5)
> 1. Mylyn bundles do not get loaded

Filed as a subissue.

> 2. masterfs.windows is apparently loaded even on Unix

Should be fixed in core-main #78ba887f3eb9.
Comment 10 Quality Engineering 2012-05-01 09:53:27 UTC
Integrated into 'main-golden', will be available in build *201205010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d32a0c8a0f7b
User: Jesse Glick <jglick@netbeans.org>
Log: 98c8b62e79a8 cont'd (diagnosing #210325 problem #2): if a Lookup.Item.instance==null, generally because its initializer threw an error, continue looking for others.
Comment 11 Jesse Glick 2012-06-07 22:58:02 UTC
(In reply to comment #5)
> 3. Some linkage problem with org.w3c.dom.traversal

Indeed org.apache.xerces.dom implements org.w3c.dom.traversal.DocumentTraversal, which is defined in xml-apis.jar and rt.jar but absent from JDK 6/7 Javadoc and (current) Felix's default.properties and therefore not exported to bundles by default. Since org.netbeans.libs.xerces does not include this package (warned during build "imports of no known origin"), Felix correctly rejects attempts to link to it. Workaround is to pass it to felix-sys-prop.org.osgi.framework.system.packages.extra.
Comment 12 Jesse Glick 2012-06-07 23:24:37 UTC
(In reply to comment #5)
> 4. nbinst://org.apache.commons.logging/modules/org-apache-commons-logging.jar
> and the like unresolved (e.g. in Classpath for Hibernate JPA library).

core-main #23efa49d38ae
Comment 13 Jesse Glick 2012-06-07 23:41:41 UTC
(In reply to comment #8)
> 5. Need to write test for LayerProvider.

Filed as blocking issue. Everything else now fixed or filed separately.
Comment 14 Quality Engineering 2012-06-09 04:33:35 UTC
Integrated into 'main-golden', will be available in build *201206090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/23efa49d38ae
User: Jesse Glick <jglick@netbeans.org>
Log: #210325 item 4: IFL sometimes used to find module JARs themselves.