[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Equinox Declarative Services : Context Class Loader
- From: Neil Bartlett <njbartlett@xxxxxxxxx>
- Date: Tue, 31 Mar 2009 12:19:16 +0100
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=go4afpxgVkegSNRvFEhRcdhicmb3xolifQh9dNUHX7WEcsZ/2hbxuwsLodIqYTx2Kj D/JGz/t199jCgiVWpqk+XF4K/SS+uCzTuOngetj+jNO0tRRa3CCiBDV8qlJeeiXhyiQo C/vUngUIqdv8Xz9XAhAzi0dlyDwUHEJNVU7bU=
The question is, what did you expect instead of null?
The OSGi spec does not specify what the thread context classloader
(TCCL) should be when services or callbacks are invoked, therefore
components should not rely on it being set to anything in particular.
You can of course set the TCCL explicitly at the start of your
The reason for this, incidentally, is that TCCLs are intended to
support the concept of a global "application", and they are not really
a good fit with the classloading model in OSGi. However as you have
probably discovered, many legacy libraries have expectations about the
TCCL and we must work around those expectations. You may wish to look
at the Spring-DM component framework as an alternative to DS, as it
does include some support for declaratively setting the TCCL in
service methods (I'm not sure if it also works in the "init" and
"destroy" methods though).
2009/3/31 Sameera Jayasoma <sameera.madushan@xxxxxxxxx>:
> Hi all
> I am using Equinox Declarative Services implementation. When my component
> gets activated, the âactivateâ method is invoked on the component
> implementation class and that is expected behavior. But the context class
> loader of the thread which invoke the âactivateâ method is null. I am having
> problems because of this. Is this the expected behavior in the DS
> implementation? Any help would be greatly appreciated.
> Sameera Jayasoma
> equinox-dev mailing list