Hi Andrew, Thanks for your response! I am re-sending the java file and the log that I had sent earlier for your reference.
Any help with this is appreciated! Thank you. Regards, Mangirish Wagle On Sat, Mar 19, 2016 at 2:26 PM, Andrew Phillips <andr...@apache.org> wrote: > Hi Mangirish > > Could you kindly send the code snippet you're using to create your > context, and the wire and header logs [1] for the authentication calls > where you are seeing this problem? > > Regards > > ap > > [1] http://jclouds.apache.org/reference/logging/ > > On 2016-03-18 15:55, Mangirish Wagle wrote: > >> Hello, >> >> I just realized that the JCloud hits an incorrect URL for openstack:- >> >> What JCloud hits:- >> POST http://<IP>:5000/v3/tokens HTTP/1.1 >> >> What should it be:- >> POST http://<IP>:5000/v3/*auth/*tokens HTTP/1.1 >> >> Reference:- >> http://developer.openstack.org/api-ref.html >> >> Thanks. >> >> Regards, >> Mangirish Wagle >> >> On Fri, Mar 18, 2016 at 1:17 PM, Mangirish Wagle < >> vaglomangir...@gmail.com> >> wrote: >> >> Hello JClouds Dev team, >>> >>> I am working on using JClouds to interact with Openstack (experimental >>> devstack setup on a remote machine) and its failing with a HTTP 404 >>> error:- >>> >>> Error log with error and the sample program is attached. >>> >>> The issue looks related to the discussion in:- >>> http://www.mail-archive.com/dev@jclouds.apache.org/msg06330.html >>> >>> However, its not very clear to me how to handle it. >>> >>> Any help with this will be greatly appreciated. >>> >>> Thanks, >>> >>> Regards, >>> Mangirish Wagle >>> >>>
package edu.airavata.poc; import com.google.common.collect.ImmutableSet; import com.google.common.io.Closeables; import com.google.inject.Module; import com.sun.security.ntlm.Client; import org.jclouds.ContextBuilder; import org.jclouds.compute.ComputeService; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.domain.ComputeMetadata; import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; import org.jclouds.openstack.nova.v2_0.NovaApi; import org.jclouds.openstack.nova.v2_0.domain.Server; import org.jclouds.openstack.nova.v2_0.features.ServerApi; import java.io.Closeable; import java.io.IOException; import java.util.Set; public class JCloudsNova implements Closeable { private final ComputeServiceContext context; private final ComputeService client; public static void main(String[] args) throws IOException { System.setProperty("jsse.enableSNIExtension", "false"); JCloudsNova jcloudsNova = new JCloudsNova(); try { jcloudsNova.listServers(); //jcloudsNova.close(); } catch (Exception e) { e.printStackTrace(); } finally { jcloudsNova.close(); } } public JCloudsNova() { Iterable<Module> modules = ImmutableSet.<Module>of(new SLF4JLoggingModule()); String provider = "openstack-nova"; String identity = "demo:admin"; // tenantName:userName String credential = "xxxx"; context = ContextBuilder.newBuilder(provider) .endpoint("http://<IP>:5000/v3") .apiVersion("v3") .credentials(identity, credential) .modules(modules) .buildView(ComputeServiceContext.class); //regions = novaApi.getConfiguredRegions(); client = context.getComputeService(); } private void listServers() { //for (String region : regions) { //ServerApi serverApi = novaApi.getServerApi(region); //System.out.println("Servers in " + region); //for (Server server : serverApi.listInDetail().concat()) { // System.out.println(" " + server); //} //} for (ComputeMetadata node : client.listNodes()) { //node.getId(); // how does jclouds address this in a global scope //node.getProviderId(); // how does the provider api address this in a specific scope node.getName(); // if the node is named, what is it? //node.getLocation(); // where in the world is the node } } public void close() throws IOException { Closeables.close(context, true); } }
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. com.google.common.util.concurrent.UncheckedExecutionException: org.jclouds.rest.ResourceNotFoundException: {"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}} at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201) 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 org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:45) at org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:33) at com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:67) 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 org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:218) at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:122) at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listNodes(AdaptingComputeServiceStrategies.java:112) at org.jclouds.compute.internal.BaseComputeService.listNodes(BaseComputeService.java:335) 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.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37) at com.sun.proxy.$Proxy58.listNodes(Unknown Source) at edu.airavata.poc.JCloudsNova.listServers(JCloudsNova.java:69) at edu.airavata.poc.JCloudsNova.main(JCloudsNova.java:31) Caused by: org.jclouds.rest.ResourceNotFoundException: {"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}} at org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler.handleError(NovaErrorHandler.java:97) 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.$Proxy55.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) ... 43 more Caused by: org.jclouds.http.HttpResponseException: command: POST http://<IP>:5000/v3/tokens HTTP/1.1 failed with response: HTTP/1.1 404 Not Found; content: [{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}] at org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler.handleError(NovaErrorHandler.java:78) ... 61 more