BUG Community

Welcome! Log In

Forums Applications Exception starting a new app in a new workspace

Subscribe to Exception starting a new app in a new workspace  12 posts, 3 voices

Log in to reply to this topic
 
Oct 3, 2007 12:28am
Medium Bug Labs team finsprings 268 posts

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.

Any ideas?

Oct 3, 2007 12:43am
Medium Bug Labs team mcholerton 54 posts

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!

Oct 3, 2007 8:01am
Medium Bug Labs team finsprings 268 posts

"finsprings"
created a simple little project from scratch


I should say that by 'from scratch' I mean 'cut and paste bits from FlickrUppr then ripped out the stuff I didn't want ;-)
Oct 3, 2007 9:06am
Medium Bug Labs team mcholerton 54 posts

Still cool finsprings! That’s how you dig in and how this stuff will start to grow.

Oct 3, 2007 11:07am
Medium Bug Labs team kgilmer 215 posts

finesprings,

Strange, looks like there is a Eclipse launch configuration issue. At the Concierge "(:" console type "bundles" and tell me what you get in response…

Oct 3, 2007 9:08pm
Medium Bug Labs team finsprings 268 posts

(: 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

(:

Oct 3, 2007 10:45pm
Medium Bug Labs team finsprings 268 posts

I tried copying the app to the workspace with all the sample apps and it failed the same way.

I fixed this by comparing section by section against FlickrUppr. It turned out that I had to edit the MANIFEST.MF and add the following:

Import-Package: com.buglabs.application,
com.buglabs.module,
com.buglabs.util,
org.osgi.framework,
org.osgi.util.tracker;

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.

Oct 3, 2007 11:12pm
Medium Bug Labs team finsprings 268 posts

Actually, it barfed once I selected the GPS and LCD with another class not found error. I changed it to:

Manifest-Version: 1.0
Bundle-Name: GpsLogger
Bundle-Activator: gpslogger.Activator
Bundle-SymbolicName: GpsLogger
Bundle-Version: 1.0.0
Bug-Bundle-Type: Application
Import-Package: com.buglabs.application,
com.buglabs.bug.module.gps.pub,
com.buglabs.bug.module.lcd.pub,
com.buglabs.util,
org.osgi.framework,
org.osgi.util.tracker

and it’s now running.

Oct 3, 2007 11:27pm
Medium Bug Labs team mcholerton 54 posts

Thanks for sharing your progress in working through this. Great to hear you got it running.

Oct 4, 2007 2:16pm
Medium Bug Labs team kgilmer 215 posts

Finsprings ~

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:

http://www2.osgi.org/Specifications/HomePage#Re…

Oct 4, 2007 2:19pm
Medium Bug Labs team kgilmer 215 posts

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.

Oct 4, 2007 3:18pm
Medium Bug Labs team finsprings 268 posts

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.

Log in to reply to this topic
Forums Applications Exception starting a new app in a new workspace

Powered by Community Engine

Top
Login
Close
Bottom