java.util.NoSuchElementException: key [aws-ec2] not in the list of providers or apis: {}

701 views
Skip to first unread message

Nirmal Fernando

unread,
Jun 10, 2012, 6:58:47 AM6/10/12
to jcl...@googlegroups.com
Hi All,

I'm getting [1] below, when I try to do [2]. I've installed following jars in my OSGi environment.

id    State       Bundle
15    ACTIVE      aws_ec2_1.5.0_beta.1_1.0.0
40    ACTIVE      ec2_1.5.0_beta.1_1.0.0
59    ACTIVE      jclouds_compute_1.5.0_beta.1_1.0.0
60    ACTIVE      jclouds_core_1.5.0_beta.1_1.0.0
61    ACTIVE      jclouds_enterprise_1.5.0_beta.1_1.0.0
62    ACTIVE      jclouds_slf4j_1.5.0_beta.1_1.0.0
63    ACTIVE      jclouds_sshj_1.5.0_beta.1_1.0.0

What could be the reason? Appreciate any help!

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

[2]
ContextBuilder builder = ContextBuilder.newBuilder("aws-ec2")
                .credentials(identity, credential)
                .modules(modules)
                .overrides(properties);

--

Thanks & regards,
Nirmal

Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/

Ioannis Canellos

unread,
Jun 10, 2012, 8:06:01 AM6/10/12
to jcl...@googlegroups.com
I see you are using the 1.5.0.beta.1 version. This is the last version of jclouds that makes use of OSGi fragments, so its possible that you'll need to refresh bundle 60 (jclouds core) so that the compute bundle can get attached to it. This has been changed on trunk and will not be needed in beta.2 or any future version of jclouds.

--
Ioannis Canellos

Twitter: iocanel


Nirmal Fernando

unread,
Jun 11, 2012, 12:50:25 AM6/11/12
to jcl...@googlegroups.com
I think the exact reason for the error I'm seen can be found in here http://aries.apache.org/modules/spi-fly.html

I'm gonna try out the solution provided by Apache Aries!!

Hopefully it works well !!

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Nirmal Fernando

unread,
Jun 11, 2012, 1:53:00 AM6/11/12
to jcl...@googlegroups.com
Yes, that did the trick! Seems like JClouds should use Apache Aries' SPI-FLY component's dynamic bundle.

Ioannis Canellos

unread,
Jun 12, 2012, 4:19:06 AM6/12/12
to jcl...@googlegroups.com
Hi Nirmal,

I've committed a change that will help any OSGi users to discover providers without the need of using external tools such as spi-fly or implementing their own patterns for discovery.
The change has been part of the beta.2 candidate which is available for testing at: https://oss.sonatype.org/content/repositories/orgjclouds-549/

Could you please have a look and let us know if that solves your problems?

Thanks,

Nirmal Fernando

unread,
Jun 12, 2012, 4:37:50 AM6/12/12
to jcl...@googlegroups.com
Hi Ioannis,

On Tue, Jun 12, 2012 at 1:49 PM, Ioannis Canellos <ioc...@gmail.com> wrote:
Hi Nirmal,

I've committed a change that will help any OSGi users to discover providers without the need of using external tools such as spi-fly or implementing their own patterns for discovery.
The change has been part of the beta.2 candidate which is available for testing at: https://oss.sonatype.org/content/repositories/orgjclouds-549/

Could you please have a look and let us know if that solves your problems?

Thanks for the prompt action! I'm downloading the jars ... :)
 

Thanks,
--
Ioannis Canellos

Twitter: iocanel


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Nirmal Fernando

unread,
Jun 12, 2012, 5:36:30 AM6/12/12
to jcl...@googlegroups.com
Hi All,

With beta-2 packs, all went well!!! :-) Awesome work Ioannis!!

Appreciate very much!!

Nirmal Fernando

unread,
Jun 13, 2012, 11:08:41 AM6/13/12
to jcl...@googlegroups.com
Hi Ioannis,

Seems like with your approach I should set a higher bundle start value to provider jars, otherwise jclouds-core won't pick it up.

Scenario: EC2 provider bundle get started before jcloud-core bundle, and bundle listener in core can't see any bundle event occurring from that EC2 provider bundle, since it is already started. Hence, EC2 provider won't get added!

Can you see any code level solution to this problem?

Ioannis Canellos

unread,
Jun 13, 2012, 11:20:00 AM6/13/12
to jcl...@googlegroups.com
I guess we could have the core bundle scan any of the existing ones.

Chris Custine

unread,
Jun 13, 2012, 11:38:01 AM6/13/12
to jcl...@googlegroups.com
How about adding that init() to the bundlelistener (same as jclouds-karaf version) and just calling it from the activator?  I am also wondering if ApiMetadata is also necessary here?  Did that complicate things too much given the release schedule?

-- 
Chris Custine

Nirmal Fernando

unread,
Jun 13, 2012, 11:42:51 AM6/13/12
to jcl...@googlegroups.com
Hi Chris,

On Wed, Jun 13, 2012 at 9:08 PM, Chris Custine <chris....@gmail.com> wrote:
How about adding that init() to the bundlelistener (same as jclouds-karaf version) and just calling it from the activator?  I am also wondering if ApiMetadata is also necessary here?

It's necessary for openstack to work, and I reported in another thread!
 
 Did that complicate things too much given the release schedule?

-- 
Chris Custine

On Wednesday, June 13, 2012 at 9:20 AM, Ioannis Canellos wrote:

I guess we could have the core bundle scan any of the existing ones.

--
Ioannis Canellos

Twitter: iocanel


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

JJC001

unread,
Oct 10, 2012, 9:41:05 AM10/10/12
to jcl...@googlegroups.com
Hi
I am getting this problem using jclouds 1.5.1 when compiling with the maven-shade-plugin or the maven-assembly-plug-in, any ideas how I might go about fixing it?
John.

Adrian Cole

unread,
Oct 10, 2012, 9:49:14 AM10/10/12
to jcl...@googlegroups.com
Hi, John.

This is probably related to serviceloader references. Here's an
example pom that deals with this:

https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/pom.xml

-A
> To view this discussion on the web visit
> https://groups.google.com/d/msg/jclouds/-/BbeZimbMrXUJ.

Nirmal Fernando

unread,
Oct 10, 2012, 9:50:52 AM10/10/12
to jcl...@googlegroups.com
Hi John,

Not sure, whether this helps.

On Wed, Oct 10, 2012 at 7:11 PM, JJC001 <johnj.ch...@gmail.com> wrote:
Hi
I am getting this problem using jclouds 1.5.1 when compiling with the maven-shade-plugin or the maven-assembly-plug-in, any ideas how I might go about fixing it?

I used maven shade plugin like following in my project's pom.

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.7.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <includes>
                                    <include>org.jclouds:*</include>
                                    <include>org.jclouds.*:*</include>
                                </includes>
                            </artifactSet>
                            <filtering>true</filtering>
                            <filters>
                                <filter>
                                    <artifact>org.jclouds*:*</artifact>
                                    <includes>
                                        <include>META-INF/services/org.jclouds.apis.ApiMetadata</include>
                                        <include>META-INF/services/org.jclouds.providers.ProviderMetadata</include>
                                    </includes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


 
John.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/BbeZimbMrXUJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

JJC001

unread,
Oct 10, 2012, 10:44:22 AM10/10/12
to jcl...@googlegroups.com
Hi Adrian, Nirmal
 
Adrians suggestion worked brilliantly thanks. Thanks for the response Nirmal but I tired Adrian's solution first and it did the trick.
 
Thanks to both for the quick response.
 
John.
Reply all
Reply to author
Forward
0 new messages