BTW: Beside the felix framework itself I'm currently only loading those three bundles:
org.apache.felix.shell-1.2.0.jar org.apache.felix.shell.tui-1.2.0.jar org.apache.felix.eventadmin-1.0.0.jar Do I have to add some of the OSGi API bundles as well? BR, Markus 2009/7/14 Markus Michel <[email protected]> > Hi Richard! > > Of course I can provide more informations. The manifest file of the bundle > looks like this: > > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: VehiclePushService > Bundle-SymbolicName: VehiclePushService > Bundle-Version: 1.0.0 > Bundle-Activator: vehiclePushService.Activator > Import-Package: org.osgi.framework;version="1.3.0", > org.osgi.service.event;version="1.1.0", > vehiclePushService > Bundle-RequiredExecutionEnvironment: JavaSE-1.6 > Bundle-ClassPath: ., > vehiclePushService.jar > Export-Package: > osgiServices.vehiclePushService, > vehiclePushService > > The content of the bundle looks as follows: > > META-INF/ > META-INF/MANIFEST.MF > hostApplication/ > hostApplication/vehiclePushService/ > osgiFramework/ > osgiFramework/vehiclePushService/ > vehiclePushService/ > META-INF/.classpath > META-INF/.project > vehiclePushService.jar > vehiclePushService/Activator.class > vehiclePushService/OSGiPosition2D.class > vehiclePushService/OSGiVehicle.class > vehiclePushService/OSGiVehiclePushService.class > vehiclePushService/VehicleListener.class > vehiclePushService/VehiclePushEvent.class > vehiclePushService/VehiclePushServiceHandler.class > > Because inside the plug-in dependencies org.eclipse.services is referenced > I think that the bundles currently uses the equinox implementation of the > eventadmin service. Later on I will try to load the equinox eventadmin > service instead > of the felix eventadmin service. Maybe it's then possible to start my > bundle ... > > BR, > > Markus > > > 2009/7/13 Richard S. Hall <[email protected]> > > On 7/13/09 2:47 PM, Markus Michel wrote: >> >>> Hi there! >>> >>> Today I wanted to add the eventadmin service to my OSGi environment. >>> Therefore I extended the import block of my bundle, which is created >>> within >>> an eclipse equinox project, with org.osgi.service.event. After loading >>> the >>> service I tried to access it by running the following command: >>> >>> // get service reference to event admin service >>> serviceReference = >>> bundleContext.getServiceReference(EventAdmin.class.getName()); >>> >>> // check if service reference is valid >>> if (serviceReference != null) >>> { >>> eventAdmin = (EventAdmin) >>> bundleContext.getService(serviceReference); >>> } >>> >>> But inside the if-loop I'm getting an error: >>> >>> java.lang.ClassCastException: >>> org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator >>> cannot >>> be cast to org.osgi.service.event.EventAdmin >>> >>> I'm a little bit confused now, because I thought that the Apache Felix >>> framework is fully compatible to the OSGi specifications?!? >>> >> >> While the Felix framework isn't yet 100% compliant, it is very close and >> getting closer every release. >> >> Isn't it >>> possible to mix equinox components (my bundle) with felix components (the >>> eventadmin service)? >>> >>> Does anybody has an idea how I can solve my problem? >>> >>> >> >> Such a scenario should work, but you didn't provide enough information to >> say why it isn't. Perhaps you could show us your bundle's manifest file as >> well as a "jar tf" of the bundle. >> >> -> richard >> >> BR, >>> >>> Markus >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >>

