Re: How to use jclouds with OpenStack Swift?
But I got an error: Ah, sorry to hear :-( Glad we're getting closer, though. Could you enable header and wire logging [1], run the request again and please put the output (with sensitive information removed) into a Gist or Pastie? That will hopefully give us a bit more insight into the exact request being made, and why your Openstack installation isn't happy with it. Regards ap [1] https://jclouds.apache.org/reference/logging/
Re: How to use jclouds with OpenStack Swift?
My OpenStack Swift works if I use curl: //authenticate curl -v -H 'X-Auth-User: admin:admin' -H 'X-Auth-Key: admin' http://192.168.0.58:8080/auth/v1.0/ //check containers curl -v -H 'X-Storage-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' http://192.168.0.58:8080/v1/AUTH_admin/ //create a container curl -v -H 'X-Storage-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' -X PUT http://192.168.0.58:8080/v1/AUTH_admin/mycontainer //upload file swift -A http://192.168.0.58:8080/auth/v1.0/ -U admin:admin -K admin upload mycontainer some_file //get file curl -v -H 'X-Auth-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' -X GET http://192.168.0.58:8080/v1/AUTH_admin/mycontainer/some_file On Wed, Sep 14, 2016 at 11:37 PM, Alexandr Porunov < alexandr.poru...@gmail.com> wrote: > Andrew, > > Ignasi Barrera helped me. I had to use Gson version 2.5 to handle that > error. > > As you said I tried to call: > Set regions = swiftApi.getConfiguredRegions(); > > But I got an error: > Request processing failed; nested exception is > org.jclouds.http.HttpResponseException: > command: POST http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed > with response: HTTP/1.1 400 Bad Request; content: [Bad > RequestThe server could not comply with the request since it is > either malformed or otherwise incorrect.]] with root cause > org.jclouds.http.HttpResponseException: command: POST > http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed with response: > HTTP/1.1 400 Bad Request; content: [Bad RequestThe server > could not comply with the request since it is either malformed or otherwise > incorrect.] > at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler. > handleError(SwiftErrorHandler.java:46) > at org.jclouds.http.handlers.DelegatingErrorHandler.handleError( > DelegatingErrorHandler.java:65) > at org.jclouds.http.internal.BaseHttpCommandExecutorService > .shouldContinue(BaseHttpCommandExecutorService.java:136) > at org.jclouds.http.internal.BaseHttpCommandExecutorService > .invoke(BaseHttpCommandExecutorService.java:105) > at org.jclouds.rest.internal.InvokeHttpMethod.invoke( > InvokeHttpMethod.java:90) > at org.jclouds.rest.internal.InvokeHttpMethod.apply( > InvokeHttpMethod.java:73) > at org.jclouds.rest.internal.InvokeHttpMethod.apply( > InvokeHttpMethod.java:44) > at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle( > DelegatesToInvocationFunction.java:156) > at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke( > DelegatesToInvocationFunction.java:123) > at > com.sun.proxy.$Proxy111.authenticateWithTenantNameAndCredentials(Unknown > Source) > at org.jclouds.openstack.keystone.v2_0.functions. > AuthenticatePasswordCredentials.authenticateWithTenantName( > AuthenticatePasswordCredentials.java:43) > at org.jclouds.openstack.keystone.v2_0.functions. > AuthenticatePasswordCredentials.authenticateWithTenantName( > AuthenticatePasswordCredentials.java:31) > at org.jclouds.openstack.keystone.v2_0.functions. > internal.BaseAuthenticator.apply(BaseAuthenticator.java:79) > at org.jclouds.openstack.keystone.v2_0.functions. > internal.BaseAuthenticator.apply(BaseAuthenticator.java:36) > at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load( > CacheLoader.java:148) > at com.google.common.cache.LocalCache$LoadingValueReference. > loadFuture(LocalCache.java:3524) > at com.google.common.cache.LocalCache$Segment.loadSync( > LocalCache.java:2317) > at com.google.common.cache.LocalCache$Segment. > lockedGetOrLoad(LocalCache.java:2280) > at com.google.common.cache.LocalCache$Segment.get( > LocalCache.java:2195) > at com.google.common.cache.LocalCache.get(LocalCache.java:3934) > at com.google.common.cache.LocalCache.getOrLoad( > LocalCache.java:3938) > at com.google.common.cache.LocalCache$LocalLoadingCache. > get(LocalCache.java:4821) > at com.google.common.cache.LocalCache$LocalLoadingCache. > getUnchecked(LocalCache.java:4827) > at org.jclouds.openstack.keystone.v2_0.config. > KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:234) > at org.jclouds.openstack.keystone.v2_0.config. > KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:231) > at org.jclouds.openstack.keystone.v2_0.suppliers. > LocationIdToURIFromAccessForTypeAndVersion.get( > LocationIdToURIFromAccessForTypeAndVersion.java:94) > at org.jclouds.openstack.keystone.v2_0.suppliers. > LocationIdToURIFromAccessForTypeAndVersion.get( > LocationIdToURIFromAccessForTypeAndVersion.java:54) > at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOn > AuthorizationExceptionSupplier$SetAndThrowAuthorizationExcept > ionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOn > AuthorizationExceptionSupplier.java:73) > at
Re: How to use jclouds with OpenStack Swift?
Andrew, Ignasi Barrera helped me. I had to use Gson version 2.5 to handle that error. As you said I tried to call: Set regions = swiftApi.getConfiguredRegions(); But I got an error: Request processing failed; nested exception is org.jclouds.http.HttpResponseException: command: POST http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [Bad RequestThe server could not comply with the request since it is either malformed or otherwise incorrect.]] with root cause org.jclouds.http.HttpResponseException: command: POST http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [Bad RequestThe server could not comply with the request since it is either malformed or otherwise incorrect.] at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError(SwiftErrorHandler.java:46) at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:136) at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105) at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156) at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123) at com.sun.proxy.$Proxy111.authenticateWithTenantNameAndCredentials(Unknown Source) at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:43) at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:31) at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:79) at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:36) at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:148) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:234) at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:231) at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:94) at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:54) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:73) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:119) at
Re: Can not create SwiftApi with tempauth
Thank you. I forced to use Gson 2.5 but now I have problems with regions. When I use: Set regions = swiftApi.getConfiguredRegions(); I get an error: Request processing failed; nested exception is org.jclouds.http.HttpResponseException: command: POST http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [Bad RequestThe server could not comply with the request since it is either malformed or otherwise incorrect.]] with root cause org.jclouds.http.HttpResponseException: command: POST http://192.168.0.58:8080/auth/v1.0/tokens HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [Bad RequestThe server could not comply with the request since it is either malformed or otherwise incorrect.] at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError(SwiftErrorHandler.java:46) at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:136) at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:105) at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156) at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123) at com.sun.proxy.$Proxy111.authenticateWithTenantNameAndCredentials(Unknown Source) at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:43) at org.jclouds.openstack.keystone.v2_0.functions.AuthenticatePasswordCredentials.authenticateWithTenantName(AuthenticatePasswordCredentials.java:31) at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:79) at org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:36) at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:148) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:234) at org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:231) at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:94) at org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:54) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:73) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) at com.google.common.cache.LocalCache.get(LocalCache.java:3934) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:119) at
Re: How to use jclouds with OpenStack Swift?
Yes, I found Gson in the classpath. It has version 2.7 On Wed, Sep 14, 2016 at 8:48 PM, Alexandr Porunov < alexandr.poru...@gmail.com> wrote: > Hello Andrew, > > Now I cannot call that method because I cannot connect to OpenStack Swift > itself. I always get next error: > http://paste.openstack.org/show/576305/ > > Here is my proxy 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 > > 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); > > Can you help me please? > > Regards, > Alexandr > > On Wed, Sep 14, 2016 at 7:21 PM, Andrew Phillips> wrote: > >> What is "RegionOne" ? First of all if we talk about regions in Swift >>> then it can't be a String. It is Integer value. That is why I can't >>> understand what is "RegionOne" and how to create a simple container >>> with SwiftApi. >>> >> >> Could you call "getConfiguredRegions" on your API instance to see which >> regions are available? >> >> https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclou >> ds/openstack/swift/v1/SwiftApi.html#getConfiguredRegions() >> >> Regards >> >> ap >> > >
Re: Can not create SwiftApi with tempauth
If you use Spring Boot 1.4, then you might be affected by JCLOUDS-1160 [1], as it comes with a Gson version newer than the one supported by jclouds. See the issue and the linked one for more details. If that is your case, is there any chance you can force a version of Gson <= 2.5? [1] https://issues.apache.org/jira/browse/JCLOUDS-1160 On 14 September 2016 at 20:07, Alexandr Porunovwrote: > I use 1.9.2 version of jclouds as in the example. > Here is my gradle dependencies: > > compile group: 'org.apache.jclouds.driver', name: 'jclouds-slf4j', version: > '1.9.2' > compile group: 'org.apache.jclouds.driver', name: 'jclouds-sshj', version: > '1.9.2' > compile group: 'org.apache.jclouds.api', name: 'openstack-swift', version: > '1.9.2' > compile group: 'org.apache.jclouds.labs', name: 'openstack-marconi', > version: '1.9.2' > > > I don't use gson. But I use spring-boot framework. It may use gson. I am not > sure. But I don't see it in External Libraries. > > Also I tried to use: > SwiftApi swiftApi = ContextBuilder.newBuilder("openstack-swift") > .endpoint("http://192.168.0.58:8080/auth/v1.0;) > .credentials("admin:admin", "admin") > .buildApi(SwiftApi.class); > > It shows the same error. > > My OpenStack Swift works if I use curl: > > //authenticate > curl -v -H 'X-Auth-User: admin:admin' -H 'X-Auth-Key: admin' > http://192.168.0.58:8080/auth/v1.0/ > > //check containers > curl -v -H 'X-Storage-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' > http://192.168.0.58:8080/v1/AUTH_admin/ > > //create a container > curl -v -H 'X-Storage-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' -X PUT > http://192.168.0.58:8080/v1/AUTH_admin/mycontainer > > //upload file > swift -A http://192.168.0.58:8080/auth/v1.0/ -U admin:admin -K admin upload > mycontainer some_file > > //get file > curl -v -H 'X-Auth-Token: AUTH_tk1411104de43046aca9b371c27c3b1fad' -X GET > http://192.168.0.58:8080/v1/AUTH_admin/mycontainer/some_file > > Sincerely, > Alexandr > > > On Wed, Sep 14, 2016 at 8:56 PM, Ignasi Barrera wrote: >> >> 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 >> 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.(Lcom/google/gson/internal/ConstructorConstructor;Lcom/google/gson/FieldNamingStrategy;Lcom/google/gson/internal/Excluder;)V >> > at >> > >> > org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory.(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 >> > >> >
Re: How to use jclouds with OpenStack Swift?
Hello Andrew, Now I cannot call that method because I cannot connect to OpenStack Swift itself. I always get next error: http://paste.openstack.org/show/576305/ Here is my proxy 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 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); Can you help me please? Regards, Alexandr On Wed, Sep 14, 2016 at 7:21 PM, Andrew Phillipswrote: > What is "RegionOne" ? First of all if we talk about regions in Swift >> then it can't be a String. It is Integer value. That is why I can't >> understand what is "RegionOne" and how to create a simple container >> with SwiftApi. >> > > Could you call "getConfiguredRegions" on your API instance to see which > regions are available? > > https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclou > ds/openstack/swift/v1/SwiftApi.html#getConfiguredRegions() > > Regards > > ap >
Re: Can not create SwiftApi with tempauth
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 Porunovwrote: > 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.(Lcom/google/gson/internal/ConstructorConstructor;Lcom/google/gson/FieldNamingStrategy;Lcom/google/gson/internal/Excluder;)V > at > org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory.(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
Re: How to use jclouds with OpenStack Swift?
What is "RegionOne" ? First of all if we talk about regions in Swift then it can't be a String. It is Integer value. That is why I can't understand what is "RegionOne" and how to create a simple container with SwiftApi. Could you call "getConfiguredRegions" on your API instance to see which regions are available? https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclouds/openstack/swift/v1/SwiftApi.html#getConfiguredRegions() Regards ap
How to use jclouds with OpenStack Swift?
Hello, I am using jclouds to store objects into OpenStack Swift. The problem is that I don't understand what "region" is meant. When I need to create an object or a container I have to use next API: ContainerApi containerApi = swiftApi.getContainerApi("RegionOne"); What is "RegionOne" ? First of all if we talk about regions in Swift then it can't be a String. It is Integer value. That is why I can't understand what is "RegionOne" and how to create a simple container with SwiftApi. Please, help me to figure out how to use this API Sincerely, Alexandr
Re: unsubscribe
Hi Diego, To unsubscribe please send an email to: jclouds-user-unsubscr...@apache.org I. On Sep 14, 2016 11:02, "Diego Parrilla SantamarĂa" < diego.parrilla.santama...@gmail.com> wrote: > unsubscribe >
unsubscribe
unsubscribe