cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm O hEigeartaigh <cohei...@apache.org>
Subject Re: On classloading and EH-Cache availability checks
Date Thu, 25 Apr 2013 16:38:26 GMT
Hi Alessio,

No objections here.

Colm.


On Wed, Apr 24, 2013 at 11:24 AM, Alessio Soldano <asoldano@redhat.com>wrote:

> Hi,
> I think I might have noticed an issue (at least in my environment) with
> the way EHCache availability checks are performed in ReplayCacheFactory
> and TokenStoreFactory. The ClassLoaderUtils#loadClass method is used in
> static blocks for checking if a class from EHCache is available; if
> that's the case, a EHCache-based factory will later be used when a new
> instance is required. Now, the factory instance is actually built using
> the defining classloader of the ReplayCacheFactory / TokenStoreFactory
> class, despite the EHCache availability check having been performed
> using the current Thread context classloader (TCCL) first. If EHCache is
> visible in the TCCL that is set when initialising the abstract classes
> and not visible in their defining classloader, the newInstance
> invocation will fail.
> I would suggest performing the EHCache availability check using the
> defining classloader only in the static block; additionally, if we
> really want to try relying on stuff coming from the TCCL only, we could
> perform a new check on it when actually required to build a newInstance
> and actually use the TCCL to build the EHCache based factory through
> reflection.
> Any opinion on this?
> Cheers
> Alessio
>
> --
> Alessio Soldano
> Web Service Lead, JBoss
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message