-----Original Message----- From: Marcel Offermans [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 12, 2006 11:15 AM To: [email protected] Subject: Re: EventAdmin registered Event
Hello Leo, The code in the main activator probably contains the org.osgi.service.event package, since it uses it. Does the system bundle explicitly export this package so other bundles can use it? If you have some other bundle exporting the same package, you will get this exception because then there are two versions in the framework. Greetings, Marcel On Jul 12, 2006, at 19:57 , Kwong, Leo wrote: > java.lang.ClassCastException: > org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator > at > com.simpledevices.simplecenter.SimpleCenterCommandHandler > $CommandHandler > .run(SimpleCenterCommandHandler.java:84) > at java.lang.Thread.run(Thread.java:595) > > The piece of code that I'm writing is to post an event via the > EventAdmin, and it is not a traditional plugin. It's not made into > a jar > like a regular plugin. It doesn't import packages from the manifest > file. It works just like a regular java files. What we do is that we > override Felx and we call > > start(new MutablePropertyResolverImpl(propertyMap), getMainActivator > ()); > > where the mainActivator is a wrapper class that starts the main > application class SimpleCenter. > > > -----Original Message----- > From: Karl Pauls [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 11, 2006 10:35 PM > To: [email protected] > Subject: Re: EventAdmin registered Event > > Hello Leo, > >> When I got the service object, I can see from my IDE that it's an >> instance of EventAdminSecurityDecorator. > > This is correct. > >> However, when ask to cast the >> service object to an EventAdmin class, I get a ClassCastException. > > Could you please share the stacktrace with us? > >> There are no other class with the same name in my source tree. Can > someone >> tell me what could be wrong? Thanks! > > Do you import the org.osgi.service.event package? > >> -Leo > > regards, > > Karl > > -- > Karl Pauls > [EMAIL PROTECTED]

