Is this exception happening inside felix/eventadmin code or inside your code? Could you maybe provide the stacktrace of the exception?
regards, Karl On Wed, Feb 2, 2011 at 5:04 PM, Jackson, Bruce <bru...@qualcomm.com> wrote: > Hi All > > I'm using an embedded instance of Felix, and trying to post a simple event to > the EventAdmin service. My code is trivial: > > > ServiceReference ref = > context.getServiceReference(EventAdmin.class.getName()); > > if(ref != null) { > > EventAdmin ea = (EventAdmin) context.getService(ref); > > if(ea != null) { > > ea.postEvent(evt); > > } > > } > > The only unusual thing is that I'm calling this from "outside" the framework, > so I get my BundleContext object by calling: > > BundleContext context = felix.getBundleContext(); > > When I run this, I get the following ClassCastException: > > 02-02 15:49:28.839: ERROR/SkiftaService(12471): java.lang.ClassCastException: > org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator > > Now, if this was a ClassLoader issue, I'd expect the > context.getServiceReference() to return null, but this isn't the case. Anyone > got aany idea why I'm getting this? > > Thanks > > Bruce > -- Karl Pauls karlpa...@gmail.com