Moderator: JIDE Support
basszero wrote:I've been using JIDE in my own OSGi based application (uses Equinox, eclipse implemenation of OSGi). The classloader magic was a bit tricky and I was able to make things work without relying on implemenation specifc (buddy-policy) OSGi extensions. JIDE needs to be available to ALL of the bundles in the framework as well as the root classloader (for swing). I was able to do this by making JIDE jars into Fragment bundles of the System Bundle. Additionally, I had to combine all of the JIDE jars into one jar (hope I'm allowed to do this). This combined jar/bundle then exports ALL of the packages.
Here is the manifest line I needed:
Fragment-Host: system.bundle; extension:=framework
I don't think this works in Apache Felix because they haven't fully implements the OSGi R4 spec whereas Eclipse Equinox has.
C:\java\felix-framework-4.0.3>felix
C:\java\felix-framework-4.0.3>java.exe -jar bin/felix.jar
ERROR: Bundle com.jidesoft.demo [7] Error starting file:/C:/java/felix-framework-4.0.3/bundle/jide-demo.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.demo [7]: Unable to resolve 7.0: missing requirement [7.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.demo [7]: Unable to resolve 7.0: missing requirement [7.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Unknown Source)
ERROR: Bundle com.jidesoft.gantt [12] Error starting file:/C:/java/felix-framework-4.0.3/bundle/jide-gantt.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.gantt [12]: Unable to resolve 12.0: missing requirement [12.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.grid)(version>=3.5.0)(!(version>=4.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.gantt [12]: Unable to resolve 12.0: missing requirement [12.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.grid)(version>=3.5.0)(!(version>=4.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Unknown Source)
ERROR: Bundle com.jidesoft.plaf [25] Error starting file:/C:/java/felix-framework-4.0.3/bundle/jide-plaf.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.plaf [25]: Unable to resolve 25.0: missing requirement [25.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.plaf [25]: Unable to resolve 25.0: missing requirement [25.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Unknown Source)
C:\java\felix-framework-4.0.3>felix
C:\java\felix-framework-4.0.3>java.exe -jar bin/felix.jar
icons/title_buttons_metal.gif
icons/collapsible_pane_metal.gif
icons/collapsible_pane_default.png
icons/collapsible_pane_mask.png
icons/collapsible_pane_default.png
icons/collapsible_pane_mask.png
icons/collapsible_pane_gray.png
icons/collapsible_pane_mask.png
icons/collapsible_pane_blue.png
icons/collapsible_pane_mask.png
icons/collapsible_pane_homestead.png
icons/collapsible_pane_mask.png
icons/collapsible_pane_metallic.png
icons/collapsible_pane_mask.png
icons/title_buttons_windows.gif
icons/collapsible_pane_windows.gif
icons/collapsible_pane_vista.gif
icons/title_buttons_office2007.gif
____________________________
Welcome to Apache Felix Gogo
g! Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/jidesoft/plaf/StatusBarSeparatorUI
at com.jidesoft.status.MemoryStatusBarItem.<init>(Unknown Source)
at JideDemos.createStatusBar(JideDemos.java:177)
at JideDemos.initAndShowGUI(JideDemos.java:128)
at JideDemos.access$000(JideDemos.java:31)
at JideDemos$1.run(JideDemos.java:86)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.jidesoft.plaf.StatusBarSeparatorUI not found by com.jidesoft.common [3]
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(Unknown Source)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1317)
at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1481)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1427)
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(Unknown Source)
... 19 more
C:\java\felix-framework-4.0.3>java.exe -jar bin/felix.jar
Auto-deploy install: org.osgi.framework.BundleException: Importing java.* packages not allowed: java.sql
ERROR: Bundle com.jidesoft.demo [1] Error starting file:/C:/java/felix-framework-4.0.3/bundle/jide-demo.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.demo [1]: Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.jidesoft.demo [1]: Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (&(osgi.wiring.package=com.jidesoft.action)(version>=3.5.0)(!(version>=4.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Unknown Source)
____________________________
Welcome to Apache Felix Gogo
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (4.0.3)
1|Installed | 1|JIDE Demo (3.5.0)
3|Resolved | 1|JIDE Libs (0.0.0)
4|Active | 1|Apache Felix Bundle Repository (1.6.6)
5|Active | 1|Apache Felix Gogo Command (0.12.0)
6|Active | 1|Apache Felix Gogo Runtime (0.10.0)
7|Active | 1|Apache Felix Gogo Shell (0.10.0)
g!
Users browsing this forum: No registered users and 7 guests