karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioannis Canellos <ioca...@gmail.com>
Subject Re: Cellar And Hazelcast Questions
Date Wed, 20 Jul 2011 15:34:49 GMT
Hi Gareth,

Hazelcast is using Thread.getCurrentThread().getContextClassLoader() in
order to read object it exchanges over the cluster.
You may have to to change the context class loader before you create the
Map.

For example:

ClassLoader originalClassLoader =
Thread.currentThread().getContextClassLoader();
    try {

 Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
             //Do stuff here.
         } finally {

  Thread.currentThread().setContextClassLoader(originalClassLoader);
         }

I know its not the most elegant thing to do, but it will get things
working.

-- 
*Ioannis Canellos*
*
 http://iocanel.blogspot.com

Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/>  Committer
*

Mime
View raw message