jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <n...@apache.org>
Subject Re: Problem running digitalocean2
Date Mon, 09 Nov 2015 00:09:48 GMT
It should be fixed now. Thanks for reporting!
El 8/11/2015 8:41, "Ruben Rubio Rey" <tk421.1@gmail.com> escribió:

> Hi Ignasi,
>
> Thanks for your fast response!
>
> Regards,
> Ruben
>
> On Sat, Nov 7, 2015 at 9:03 PM, Ignasi Barrera <nacx@apache.org> wrote:
>
>> Hi Ruben,
>>
>> It looks like the service loader is trying to load the enterprisechef
>> provider, but it has been recently removed in favor of the generic chef api.
>>
>> Looking at the code, the "jclouds-all" still includes my mistake the old
>> enterprisechef dependency. I'll fix that asap.
>>
>> Meanwhile you can fix your issue by not using jclouds-all and declaring
>> just the providers/apis you use.
>>
>> HTH!
>>
>> I.
>> El 7/11/2015 10:43, "Ruben Rubio Rey" <tk421.1@gmail.com> escribió:
>>
>>> Hi,
>>>
>>> I am having trouble running digitalocean2. If I try to run this code:
>>>
>>>         final String POLL_PERIOD_TWENTY_SECONDS =
>>> String.valueOf(SECONDS.toMillis(20));
>>>
>>>         Properties overrides = new Properties();
>>>
>>> overrides.setProperty(ComputeServiceProperties.POLL_INITIAL_PERIOD,
>>> POLL_PERIOD_TWENTY_SECONDS);
>>>         overrides.setProperty(ComputeServiceProperties.POLL_MAX_PERIOD,
>>> POLL_PERIOD_TWENTY_SECONDS);
>>>
>>>         Iterable<Module> modules = ImmutableSet.<Module> of(new
>>> SshjSshClientModule(), new SLF4JLoggingModule());
>>>         //Iterable<Module> modules = ImmutableSet.<Module> of(new
>>> SshjSshClientModule());
>>>         ComputeServiceContext context =
>>> ContextBuilder.newBuilder("digitalocean2")
>>>                 .credentials("username", "password")
>>>                 .modules(modules)
>>>                 .overrides(overrides)
>>>                 .buildView(ComputeServiceContext.class);
>>>
>>>         ComputeService computeService = context.getComputeService();
>>>
>>>         TemplateOptions opts = computeService.templateOptions();
>>>         Template template = computeService.templateBuilder()
>>>                 .locationId("sfo1")
>>>                 .imageId("sfo1/debian-8-x64")
>>>                 .hardwareId("512mb")
>>>                 .options(opts.as
>>> (DigitalOcean2TemplateOptions.class).privateNetworking(true))
>>>                 .build();
>>>
>>>
>>>         Set<? extends NodeMetadata> nodes =
>>> computeService.createNodesInGroup("unittest", 1, template);
>>>         for (NodeMetadata nodeMetadata : nodes) {
>>>             System.out.println("BuildNewServerTask Login: ssh " +
>>> nodeMetadata.getCredentials().getUser() +  "@" +
>>> nodeMetadata.getPublicAddresses());
>>>             System.out.println("BuildNewServerTask Password: " +
>>> nodeMetadata.getCredentials().getPassword());
>>>         }
>>>
>>> It fails like this:
>>>
>>> java.util.ServiceConfigurationError:
>>> org.jclouds.providers.ProviderMetadata: Provider
>>> org.jclouds.enterprisechef.EnterpriseChefProviderMetadata could not be
>>> instantiated
>>>     at java.util.ServiceLoader.fail(ServiceLoader.java:224)
>>>     at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
>>>     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
>>>     at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
>>>     at
>>> com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:281)
>>>     at
>>> com.google.common.collect.ImmutableCollection$ArrayBasedBuilder.addAll(ImmutableCollection.java:360)
>>>     at
>>> com.google.common.collect.ImmutableSet$Builder.addAll(ImmutableSet.java:508)
>>>     at org.jclouds.providers.Providers.all(Providers.java:83)
>>>     at org.jclouds.providers.Providers.withId(Providers.java:99)
>>>     at org.jclouds.ContextBuilder.newBuilder(ContextBuilder.java:165)
>>>     at
>>> com.rubenrr.mvc.digitaloceanTests.newDebianJessie(digitaloceanTests.java:104)
>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>     at
>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>>>     at
>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>     at
>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>>>     at
>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>     at
>>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>>>     at
>>> org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:72)
>>>     at
>>> org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:81)
>>>     at
>>> org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
>>>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>>>     at
>>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216)
>>>     at
>>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82)
>>>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>>>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>>>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>>>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>>>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>>>     at
>>> org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60)
>>>     at
>>> org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67)
>>>     at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>>>     at
>>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162)
>>>     at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
>>>     at
>>> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
>>>     at
>>> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
>>>     at
>>> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>     at
>>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
>>> Caused by: java.lang.NoClassDefFoundError:
>>> org/jclouds/chef/config/BaseChefHttpApiModule
>>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>>>     at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>>>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>>>     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>>>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>>>     at
>>> org.jclouds.enterprisechef.EnterpriseChefApiMetadata$Builder.<init>(EnterpriseChefApiMetadata.java:65)
>>>     at
>>> org.jclouds.enterprisechef.EnterpriseChefApiMetadata.<init>(EnterpriseChefApiMetadata.java:44)
>>>     at
>>> org.jclouds.enterprisechef.EnterpriseChefProviderMetadata$Builder.<init>(EnterpriseChefProviderMetadata.java:62)
>>>     at
>>> org.jclouds.enterprisechef.EnterpriseChefProviderMetadata.builder(EnterpriseChefProviderMetadata.java:34)
>>>     at
>>> org.jclouds.enterprisechef.EnterpriseChefProviderMetadata.<init>(EnterpriseChefProviderMetadata.java:43)
>>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>> Method)
>>>     at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>>>     at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>>     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>>>     at java.lang.Class.newInstance(Class.java:379)
>>>     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
>>>     ... 41 more
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.jclouds.chef.config.BaseChefHttpApiModule
>>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
>>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
>>>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
>>>     ... 64 more
>>>
>>> Any idea how to solve this problem ?
>>>
>>> Regards,
>>> Ruben
>>>
>>
>

Mime
View raw message