Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » EventAdmin Problem
EventAdmin Problem [message #95919] Mon, 27 August 2007 11:03 Go to next message
Eclipse UserFriend
Originally posted by: beat.schaller.postfinance.ch

In a simple program i have a problem to use the EventAdmin service. As
described i put the org.eclipse.equinox.event bundle in my worbench.
In a simple application i tried to get the service in the Activator with
the following statements:

ServiceTracker eaTracker = new ServiceTracker(context,
EventAdmin.class.getName(), null);
eaTracker.open();

EventAdmin ea = (EventAdmin) eaTracker.getService();

and all i get is:
!ENTRY org.eclipse.osgi 4 0 2007-08-27 11:28:16.917
!MESSAGE An error occurred while automatically activating bundle
ch.post.pf.sample.simpleeas (19).
!STACK 0
org.osgi.framework.BundleException: Exception in
ch.post.pf.sample.simpleeas.Activator.start() of bundle
ch.post.pf.sample.simpleeas.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1018)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:149)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
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.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Caused by: java.lang.NoClassDefFoundError: org/osgi/service/event/EventAdmin
at ch.post.pf.sample.simpleeas.Activator.start(Activator.java:3 7)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
... 33 more

my manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Simpleeas Plug-in
Bundle-SymbolicName: ch.post.pf.sample.simpleeas; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: ch.post.pf.sample.simpleeas.Activator
Require-Bundle: org.eclipse.core.runtime,
org.apache.log4j,
org.eclipse.osgi.services
Eclipse-LazyStart: true

any hints?

Thanks
Beat
Re: EventAdmin Problem [message #95995 is a reply to message #95919] Mon, 27 August 2007 20:12 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
I would suggest you open a bug against Equinox->Framework and attach a
testcase that we can use to reproduce. I do not see an issue with the
information you provided, it should work.

Tom.
Re: EventAdmin Problem [message #96038 is a reply to message #95919] Tue, 28 August 2007 09:22 Go to previous message
Eclipse UserFriend
Originally posted by: beat.schaller.postfinance.ch

Beat Schaller schrieb:
> In a simple program i have a problem to use the EventAdmin service. As
> described i put the org.eclipse.equinox.event bundle in my worbench.
> In a simple application i tried to get the service in the Activator with
> the following statements:
>
> ServiceTracker eaTracker = new ServiceTracker(context,
> EventAdmin.class.getName(), null);
> eaTracker.open();
>
> EventAdmin ea = (EventAdmin) eaTracker.getService();
>
> and all i get is:
> !ENTRY org.eclipse.osgi 4 0 2007-08-27 11:28:16.917
> !MESSAGE An error occurred while automatically activating bundle
> ch.post.pf.sample.simpleeas (19).
> !STACK 0
> org.osgi.framework.BundleException: Exception in
> ch.post.pf.sample.simpleeas.Activator.start() of bundle
> ch.post.pf.sample.simpleeas.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1018)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
>
> at
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
>
> at
> org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:149)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>
> 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.equinox.launcher.Main.invokeFramework(Main.java: 504)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
> Caused by: java.lang.NoClassDefFoundError:
> org/osgi/service/event/EventAdmin
> at ch.post.pf.sample.simpleeas.Activator.start(Activator.java:3 7)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:999)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:993)
>
> ... 33 more
>
> my manifest:
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Simpleeas Plug-in
> Bundle-SymbolicName: ch.post.pf.sample.simpleeas; singleton:=true
> Bundle-Version: 1.0.0
> Bundle-Activator: ch.post.pf.sample.simpleeas.Activator
> Require-Bundle: org.eclipse.core.runtime,
> org.apache.log4j,
> org.eclipse.osgi.services
> Eclipse-LazyStart: true
>
> any hints?
>
> Thanks
> Beat

I resolved the problem. The import of the bundle as "Projects with
source folder" doesn't work. The result is an invalid Activator...????
I added the jars in Runtime/Classpath and no errors are shown. But it
doesn't work. Strange behaviour!!!

Found it by starting the bundles by hand over the console.

I imported the projects as binary projects and all worked.
Beat
Previous Topic:New runtime breaks bundle
Next Topic:extending FrameworkConsole
Goto Forum:
  


Current Time: Fri Apr 26 11:26:47 GMT 2024

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

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

Back to the top