jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <n...@apache.org>
Subject Re: Can not create SwiftApi with tempauth
Date Wed, 14 Sep 2016 17:56:03 GMT
Which version of jclouds are you using? Are you using Gson too in your
project? In that case, which version of Gson are you using?

On 14 September 2016 at 19:45, Alexandr Porunov
<alexandr.porunov@gmail.com> wrote:
> Hello,
>
> How to use jclouds with OpenStack Swift?
>
> Here is my code:
> SwiftApi swiftApi = ContextBuilder.newBuilder("openstack-swift")
>                 .endpoint("http://192.168.0.58:8080/v1/")
>                 .credentials("admin:admin", "admin")
>                 .buildApi(SwiftApi.class);
>
> I use tempauth in OpenStack Swift. Here is my configs:
> [filter:tempauth]
> use = egg:swift#tempauth
> user_admin_admin = admin .admin .reseller_admin
> user_test_tester = testing .admin
> user_test2_tester2 = testing2 .admin
> user_test_tester3 = testing3
>
> I can not create swiftApi because I always get next error:
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at
> org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
>         at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
>         at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
>         at
> org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
> Caused by: java.lang.NoSuchMethodError:
> com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.<init>(Lcom/google/gson/internal/ConstructorConstructor;Lcom/google/gson/FieldNamingStrategy;Lcom/google/gson/internal/Excluder;)V
>         at
> org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory.<init>(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:116)
>         at
> org.jclouds.json.config.GsonModule.provideGson(GsonModule.java:129)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at
> com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:104)
>         at
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
>         at
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
>         at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
>         at
> com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
>         at com.google.inject.Scopes$1$1.get(Scopes.java:65)
>         at
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
>         at
> com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
>         at
> com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
>         at
> com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
>         at
> com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
>         at
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
>         at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
>         at
> com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
>         at com.google.inject.Scopes$1$1.get(Scopes.java:65)
>         at
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
>         at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
>         at
> com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
>         at
> com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
>         at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
>         at
> com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
>         at
> com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
>         at
> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
>         at com.google.inject.Guice.createInjector(Guice.java:95)
>         at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:402)
>         at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:326)
>         at org.jclouds.ContextBuilder.buildApi(ContextBuilder.java:644)
>         at org.jclouds.ContextBuilder.buildApi(ContextBuilder.java:636)
>         at com.fyfine.loader.Application.main(Application.java:26)
>         ... 8 more
>
> Please, help me connect to OpenStack Swift
>
> Sincerely,
> Alexandr

Mime
View raw message