Thanks,
I've followed your suggestion Everett, and I created a maven project and
using your pom.xml project compile and run correctly (I can print some
properties of servers found in an openStack tenant).

Now I'm trying to create a jar of my simple example. I've added in pom.xml

 <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
                <goal>copy-dependencies</goal>
            </goals>
            <configuration>

<includeGroupIds>org.apache.jclouds.labs,org.apache.jclouds.api,ch.qos.logback,org.apache.jclouds.driver</includeGroupIds>

            </configuration>


all groupIds contained in original pom.

But when I try to launch my jar tis exception has been raised:

 java -cp ./*.jar:./dependency/*.jar -jar myapp-1.0.jar
java.lang.NoClassDefFoundError:
org/jclouds/logging/slf4j/config/SLF4JLoggingModule
        at client.openstack.JCloudsNova.init(JCloudsNova.java:45)
        at client.openstack.JCloudsNova.main(JCloudsNova.java:32)
Caused by: java.lang.ClassNotFoundException:
org.jclouds.logging.slf4j.config.SLF4JLoggingModule
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 2 more
Exception in thread "main" java.lang.NoClassDefFoundError:
org/jclouds/compute/ComputeService
        at client.openstack.JCloudsNova.close(JCloudsNova.java:75)
        at client.openstack.JCloudsNova.main(JCloudsNova.java:40)
Caused by: java.lang.ClassNotFoundException:
org.jclouds.compute.ComputeService
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 2 more

thanks
luca




2014/1/8 Everett Toews <[email protected]>

>  Hi Luca,
>
>  Trying to resolve the dependencies by downloading them individually will
> be very time consuming. I suggest using Maven.
>
>  1. If you're unfamiliar with Maven, use Maven in 5 Minutes [1] to get
> started.
>
>  2. Copy this pom.xml [2] to your working directory.
>
>  3. mvn dependency:copy-dependencies "-DoutputDirectory=./lib"
>
>  You should be able to continue the guide from that point on. Let us know
> if that works for you and I'll update the OpenStack Getting Started Guide.
>
>  Thanks,
> Everett
>
>  [1]
> http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
> [2] https://gist.github.com/everett-toews/8318536
>
>
>  On Jan 8, 2014, at 8:31 AM, Luca Maderna wrote:
>
>  Hi Andrew
>
>  I've downloaded manually some jars in order to compile
>
> JCloudsNova class 
> (http://jclouds.apache.org/documentation/quickstart/openstack/),
>
> but whn I try to run the example class a NoSuchMethodError has been raised:
>
>
> java.lang.NoSuchMethodError: 
> com.google.common.collect.ImmutableSet.builder()Lcom/google/common/collect/ImmutableSet$Builder;
>       at org.jclouds.providers.Providers.all(Providers.java:84)
>       at org.jclouds.providers.Providers.withId(Providers.java:101)
>
>
>
>       at org.jclouds.ContextBuilder.newBuilder(ContextBuilder.java:166)
>       at client.JCloudsNova.init(JCloudsNova.java:50)
>       at client.JCloudsNova.main(JCloudsNova.java:31)
>
> thanks
>
>
> luke
>
> P.S.: I usually use ant in my project not  maven
>
>
>
> 2014/1/8 Andrew Phillips <[email protected]>
>
>>  ----------
>>> 1) org.apache.jclouds:jclouds-all:jar:1.7.0
>>>
>>>   Try downloading the file manually from the project website.
>>>
>>
>>  This file certainly *is* in Maven Central:
>>
>> http://repo1.maven.org/maven2/org/apache/jclouds/jclouds-
>> all/1.7.0/jclouds-all-1.7.0.pom
>>
>> Could you try downloading this simply from a browser, or from the command
>> line? If that works, could you try running your Ant build again? If that
>> *also* doesn't work, do you perhaps have a firewall or so blocking
>> connections?
>>
>> ap
>>
>
>
>

Reply via email to