java.util.NoSuchElementException: key [aws-ec2] not in the list of
providers or
apis: {}
        at org.jclouds.ContextBuilder.newBuilder(ContextBuilder.java:174)

Seems to be a classpath issue? Any hints?

The problem here is most likely related to ServiceLoader: jclouds uses a META-INF/... file to determine the implementations of API/provider metadata classes that are available.

If you create a "fat JAR", the default logic typically picks only *one* of these files (or none of them), rather then merging them all, which is what needs to be done. See [1] for some ways of achieving this. If you're using Maven, there's also an example in jclouds-examples [2].

Hope this helps!

ap

[1] http://blog.xebia.com/2011/07/20/jar-with-deps-dont-like-meta-infservices/
[2] https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/assembly/jar-with-dependencies.xml

Reply via email to