Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Newbie Problem (NoClassDefFoundError: org/osgi/framework/BundleActivator)
Newbie Problem (NoClassDefFoundError: org/osgi/framework/BundleActivator) [message #57308] Sun, 22 January 2006 09:47 Go to next message
Eclipse UserFriend
Originally posted by: spamaccount.gmx.de

Hi,

I'm currently investigating the the possible use of OSGi in a project. To get started I
have written a very simlpe test bundle. When I try to start the bundle via the OSGi
Console I get this exception (See the complete trace at the end of the mail):

---->
Nested Exception:
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
at
<----

Here's the bundle's manifest:

---->
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: tkettler
Build-Jdk: 1.5.0_02
Extension-Name: simple
Implementation-Title: simple
Implementation-Version: 1.0
Bundle-Activator: tutorial.Activator
Bundle-Version: 1.0
Bundle-Vendor: Me
Bundle-Name: Simple Bundle
Bundle-Description: simple bundle
<----


I don't see why BundleActivator is not in the classpath since it's in the jar I started
the console from.

Any help is appreciated
-Tim




C:\Develop\osgitest\target>java -jar org.eclipse.osgi.jar -console

osgi> install file:simple-1.0.jar
Bundle id is 1

osgi> start 1
org.osgi.framework.BundleException: The activator tutorial.Activator for bundle null is
invalid
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:140)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
... 13 more
Nested Exception:
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
at
org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
at java.lang.Thread.run(Unknown Source)

osgi>
Re: Newbie Problem (NoClassDefFoundError: org/osgi/framework/BundleActivator) [message #57337 is a reply to message #57308] Sun, 22 January 2006 15:32 Go to previous messageGo to next message
Richard Backhouse is currently offline Richard BackhouseFriend
Messages: 19
Registered: July 2009
Junior Member
Try adding

Import-Package: org.osgi.framework

to the bundles manifest.

Richard


Tim Kettler wrote:
> Hi,
>
> I'm currently investigating the the possible use of OSGi in a project.
> To get started I have written a very simlpe test bundle. When I try to
> start the bundle via the OSGi Console I get this exception (See the
> complete trace at the end of the mail):
>
> ---->
> Nested Exception:
> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>
> at
> <----
>
> Here's the bundle's manifest:
>
> ---->
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: tkettler
> Build-Jdk: 1.5.0_02
> Extension-Name: simple
> Implementation-Title: simple
> Implementation-Version: 1.0
> Bundle-Activator: tutorial.Activator
> Bundle-Version: 1.0
> Bundle-Vendor: Me
> Bundle-Name: Simple Bundle
> Bundle-Description: simple bundle
> <----
>
>
> I don't see why BundleActivator is not in the classpath since it's in
> the jar I started the console from.
>
> Any help is appreciated
> -Tim
>
>
>
>
> C:\Develop\osgitest\target>java -jar org.eclipse.osgi.jar -console
>
> osgi> install file:simple-1.0.jar
> Bundle id is 1
>
> osgi> start 1
> org.osgi.framework.BundleException: The activator tutorial.Activator for
> bundle null is invalid
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:140)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NoClassDefFoundError:
> org/osgi/framework/BundleActivator
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)

>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>
> ... 13 more
> Nested Exception:
> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>
> at java.lang.Thread.run(Unknown Source)
> Nested Exception:
> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>
> at
> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>
> at
> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>
> at java.lang.Thread.run(Unknown Source)
>
> osgi>
Re: Newbie Problem (NoClassDefFoundError: org/osgi/framework/BundleActivator) [message #57363 is a reply to message #57337] Sun, 22 January 2006 19:11 Go to previous message
Eclipse UserFriend
Originally posted by: spamaccount.gmx.de

Thanks,

that did the trick.

-Tim

Richard Backhouse schrieb:
> Try adding
>
> Import-Package: org.osgi.framework
>
> to the bundles manifest.
>
> Richard
>
>
> Tim Kettler wrote:
>> Hi,
>>
>> I'm currently investigating the the possible use of OSGi in a project.
>> To get started I have written a very simlpe test bundle. When I try to
>> start the bundle via the OSGi Console I get this exception (See the
>> complete trace at the end of the mail):
>>
>> ---->
>> Nested Exception:
>> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>>
>> at
>> <----
>>
>> Here's the bundle's manifest:
>>
>> ---->
>> Manifest-Version: 1.0
>> Archiver-Version: Plexus Archiver
>> Created-By: Apache Maven
>> Built-By: tkettler
>> Build-Jdk: 1.5.0_02
>> Extension-Name: simple
>> Implementation-Title: simple
>> Implementation-Version: 1.0
>> Bundle-Activator: tutorial.Activator
>> Bundle-Version: 1.0
>> Bundle-Vendor: Me
>> Bundle-Name: Simple Bundle
>> Bundle-Description: simple bundle
>> <----
>>
>>
>> I don't see why BundleActivator is not in the classpath since it's in
>> the jar I started the console from.
>>
>> Any help is appreciated
>> -Tim
>>
>>
>>
>>
>> C:\Develop\osgitest\target>java -jar org.eclipse.osgi.jar -console
>>
>> osgi> install file:simple-1.0.jar
>> Bundle id is 1
>>
>> osgi> start 1
>> org.osgi.framework.BundleException: The activator tutorial.Activator
>> for bundle null is invalid
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:140)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>>
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.lang.NoClassDefFoundError:
>> org/osgi/framework/BundleActivator
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
>
>
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>>
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>>
>> ... 13 more
>> Nested Exception:
>> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>>
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>>
>> at java.lang.Thread.run(Unknown Source)
>> Nested Exception:
>> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.d efineClass(DefaultClassLoader.java:370)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineCl ass(EclipseClassLoader.java:234)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClassImpl(DefaultClassLoader.java:343)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.f indClass(DefaultClassLoader.java:235)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. findLocalClass(AbstractClassLoader.java:183)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFin dLocalClass(EclipseClassLoader.java:142)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:73)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:389)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
>>
>> at
>> org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
>>
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:275)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:133)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:965)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:316)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:255)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:232)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:145)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:293)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:278)
>>
>> at
>> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:213)
>>
>> at java.lang.Thread.run(Unknown Source)
>>
>> osgi>
Previous Topic:equinox server-side jsp support
Next Topic:relationship to SMF? J2ME?
Goto Forum:
  


Current Time: Sat Dec 21 13:14:21 GMT 2024

Powered by FUDForum. Page generated in 0.03575 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top