I created a separate workspace (to work around the multi-app-at-once issue) and created a simple little project from scratch via File/New Project/Dragonfly/Bug Application. It compiles okay, but when I run it I get:
STARTING file:/home/mythtv/workspace2/.metadata/.plugins/com.buglabs.osgi.concierge.runtime/bundles/GpsLogger_1.0.0.jar java.lang.NoClassDefFoundError: com/buglabs/application/AbstractServiceTracker
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at ch.ethz.iks.concierge.framework.BundleClassLoader.findOwnClass(BundleClassLoader.java:628)
at ch.ethz.iks.concierge.framework.BundleClassLoader.findClass(BundleClassLoader.java:565)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at gpslogger.Activator.start(Activator.java:21)
at ch.ethz.iks.concierge.framework.BundleImpl.startBundle(BundleImpl.java:446)
at ch.ethz.iks.concierge.framework.Framework$SystemBundle.setLevel(Framework.java:2290)
at ch.ethz.iks.concierge.framework.Framework$SystemBundle.access$0(Framework.java:2255)
at ch.ethz.iks.concierge.framework.Framework.startup(Framework.java:456)
at ch.ethz.iks.concierge.framework.Framework.main(Framework.java:313) org.osgi.framework.BundleException: Error starting bundle Bundle [13]: file:/home/mythtv/workspace2/.metadata/.plugins/com.buglabs.osgi.concierge.runtime/bundles/GpsLogger_1.0.0.jar
at ch.ethz.iks.concierge.framework.BundleImpl.startBundle(BundleImpl.java:460)
at ch.ethz.iks.concierge.framework.Framework$SystemBundle.setLevel(Framework.java:2290)
at ch.ethz.iks.concierge.framework.Framework$SystemBundle.access$0(Framework.java:2255)
at ch.ethz.iks.concierge.framework.Framework.startup(Framework.java:456)
at ch.ethz.iks.concierge.framework.Framework.main(Framework.java:313)
I noticed that /workspace2/.metadata/.plugin didn’t have com.buglabs.dragonfly, although it did have com.buglabs.dragonfly.ui. I "cp -a"d com.buglabs.dragonfly over from /workspace/.metadata/.plugin but it didn’t help.
Awesome that you were able to get things up and that you created this project – and that you are plugging away at this hour! I’ll make sure someone sees this issue in the a.m. and gets back to you!
(: bundles Id_State_NameVersionLocation__ 0 active System Bundle 0.6.3 System Bundle 1 active EventAdmin Service 0.6.1 file:/home/mythtv/eclipse/configuration/org.eclipse.osgi/bundles/171/1/.cp/jars/cg_event.jar 2 resolved Undefined Undefined file:/home/mythtv/eclipse/configuration/org.eclipse.osgi/bundles/171/1/.cp/jars/cg_framework.jar 3 resolved osgi 3.0 file:/home/mythtv/eclipse/configuration/org.eclipse.osgi/bundles/171/1/.cp/jars/osgi.jar 4 active ch.ethz.iks.slp 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/ch.ethz.iks.slp.jar 5 active com.buglabs.bug.base 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.base.jar 6 active BUG SDK Event System 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.event.jar 7 active BUG Menu Bundle 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.menu.jar 8 active BUG Module Admin 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.module.jar 9 active BUG Program Admin 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.program.jar 10 active BUG Web Service Admin 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.service.jar 11 resolved BUG Common Bundle 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.common.jar 12 active Http Service 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.osgi.http.jar 13 resolved GpsLogger 1.0.0 file:/home/mythtv/workspace2/.metadata/.plugins/com.buglabs.osgi.concierge.runtime/bundles/GpsLogger_1.0.0.jar 14 active BMI Bundle 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.bmi.jar 15 active BUG Emulator Plug-in 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.emulator.jar 16 active BUG Camera 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.emulator.module.camera.jar 17 active BUG GPS 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.emulator.module.gps.jar 18 active BUG LCD 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.emulator.module.lcd.jar 19 active BUG MOTION 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.emulator.module.motion.jar 20 active com.buglabs.bug.slp 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.bug.slp.jar 21 active com.buglabs.osgi.shell 1.0.825 file:/home/mythtv/eclipse/plugins/com.buglabs.dragonfly.bug.kernel_1.0.0.226/kernel/com.buglabs.osgi.shell.jar
It may not need all of these but that was a mostly-complete subset of what FlickrUppr had. I guess the wizard doesn’t add that stuff when you create a project.
The issues you are encountering are based on the fact that you are writing an OSGi bundle and you haven’t properly expressed your dependencies. Looks from your previous post that you’ve already pretty much figured this out, but any package that your bundle uses from another bundle needs to be added to the Imports-Package declaration of the MANIFEST.MF. The SDK (specifically CTE) in the background reads these declarations and updates your design-time classpath accordingly. You can see how the manifest file generation works by creating a new application and selecting some services.
Here is a link to get the OSGi R3 specification, which is the final authority on these sorts of things:
Another important thing I didn’t make clear is that by editing the MANIFEST.MF file, CTE will update the project classpath. So if your project fails to compile due to an invalid import/class use, adding the package necessary to the Manifest file will cause CTE to scan your workspace for a bundle that exports that same package.
Thanks, that makes sense. I had expected that the standard bundles (LCD, GPS, etc) would be pre-included when I created a project via the wizard. That would seem to be a simpler way to go for users. Of course you may not be dependent on all of those standard bundles, but it may not hurt to be linked to them anyway. I guess I was considering those bundles part of the SDK.
Failing that, it would be worth putting notes on this into the wiki.