I've read Util.loadClass source.

If null set set as the second parameter, it will first try from the current
Thread Context Classloader (so it seems semantically correct in case we're
using the standard top-down classloader delegation). If it finds, it ends

If not null, it will:

   - Use the classloader from clazz to instantiate the type, finish if
   successful
   - Use the SystemClassLoader as a last resort
   - then throw a new ClassNotFoundException

So, e.g., if BOTH jGroups and jGroups-AWS are on the parent classloader
(e.g., tomcat/server/lib), setting null will let it resort to the thread
classloader, and solve this). Same if jGroups only.

(btw, dismiss my comment about elastic-stuff. Its already working. Good
job!)

--
-- Aldrin Leal, <aldrin@leal.eng.br>
Master your EC2-fu! Get the latest ekaterminal public beta
http://www.ingenieux.com.br/products/ekaterminal/


On Mon, Jan 21, 2013 at 1:02 PM, Christian Trimble <notifications@github.com
> wrote:

> In src/main/java/com/meltmedia/jgroups/aws/AWS_PING.java:
>
> > @@ -243,7 +247,10 @@ public void start() throws Exception {
> >
> >      // start up a new ec2 client with the region specific endpoint.
> >      if( access_key == null && secret_key == null ) {
> > -      ec2 = new AmazonEC2Client();
> > +      Class<?> credsProviderClazz = Util.loadClass(credentials_provider_class, null);
>
> The arguments to this call are still a little off. I am looking at
> org.jgroups.stack.Configurator line 414 for an example of how JGroups does
> class loading. Here is some code based on the main code base:
>
> Class<?> credsProviderClazz = null;try {
>   credsProviderClazz = Util.loadClass(credentials_provider_class, getClass());}catch( ClassNotFoundException e ) {
>   throw new Exception("unable to load credentials provider class " + credentials_provider_class);}
>
>  —
> Reply to this email directly or view it on GitHub<https://github.com/meltmedia/jgroups-aws/pull/2/files#r2714130>.
>
>