Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] getservice throws class cast exception

Can you provide the manifest headers
(content of META-INF/MANIFEST.MF in your jars) as well as exact contents?

If its like you say, chances are that you didn't export/import the interface and this should result into ClassCast Exceptions..

Toni

-------- Original-Nachricht --------
> Datum: Thu, 29 May 2008 20:45:52 +0530
> Von: Santosh Akhilesh <santoshakhilesh@xxxxxxxxxx>
> An: equinox-dev@xxxxxxxxxxx
> Betreff: [equinox-dev] getservice throws class cast exception

> Dear All,
> 
>  
> 
> I am new to OSGI and Equinox.
> 
>  
> 
> I have defined an interface say A, this is defined in a project and
> exported
> as jar
> 
>  
> 
> Now I create Two OSGI bundles I include this jar in both the bundles.
> 
>  
> 
> >>From one bundle I implement the interface A and register the service to
> the
> bundle context from second bundle I try to retrieve this service from
> bundle
> context in the activator start function.
> 
>  
> 
> I can see that service is retrieved but when I cast it to interface A, I
> get
> class cast exception
> 
>  
> 
> Any pointer why this happens and how to correct it.
> 
>  
> 
> Regards,
> 
> Santosh Akhilesh
> 
> Ph: 9845482201
> 
>  
> 


Back to the top