0

Openstack juno 编排端点有额外的响应空间,所以在使用 Jclouds API 来使用 openstack 时它给了我异常,我们能做些什么吗?

{
    "endpoints": [{
        "adminURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576",
        "region": "IPTC",
        "internalURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 ",
        "id": "64667a399bb446d0bf0f6537e113ec52",
        "publicURL": "http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576"
    }],
    "endpoints_links": [],
    "type": "orchestration",
    "name": "heat"
},

如上图线条

"http://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576",

在关闭 URL 的双引号之前有一个额外的空格(我用 http 手动添加了额外的 't')

但在所有其他端点中没有额外的空间,

来自 trystack.org 的相同响应如下所示,

{
    "endpoints": [{
        "adminURL": "http://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e",
        "region": "RegionOne",
        "internalURL": "http://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e",
        "id": "38fa4f9afce34d4ca0f5e0f90fd758dd",
        "publicURL": "http://8.21.28.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e"
    }],
    "endpoints_links": [],
    "type": "orchestration",
    "name": "heat"
},

正如您在 URL“htttp://10.100.0.222:8004/v1/18b792582bba4385ac9c4820af4a8b5e”中看到的,双引号前没有空格。(我用http手动添加了额外的't')

由于 URL 有多余的空间,jclouds 中的错误如下,

Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: com.google.gson.JsonIOException: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    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.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint.apply(VersionAwareRegionToEndpoint.java:55)
    at org.jclouds.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint.apply(VersionAwareRegionToEndpoint.java:33)
    at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointInParametersOrNull(RestAnnotationProcessor.java:495)
    at org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:518)
    at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:188)
    at org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:129)
    at org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:188)
    at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:84)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
    at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
    at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
    at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
    at com.sun.proxy.$Proxy62.list(Unknown Source)
    at example.JcloudsDemo.Operations(JcloudsDemo.java:159)
    at example.JcloudsDemo.main(JcloudsDemo.java:146)
Caused by: com.google.gson.JsonIOException: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:469)
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:458)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:90)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:180)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:166)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:90)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:180)
    at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$SetTypeAdapter.read(NullFilteringTypeAdapterFactories.java:166)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:272)
    at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:184)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:80)
    at org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:44)
    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:151)
    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)
... 33 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 61: htttp://115.249.4.66:8004/v1/38bc976fd99d4ef4b6d48be6729b8576 
    at java.net.URI$Parser.fail(URI.java:2829)
    at java.net.URI$Parser.checkChars(URI.java:3002)
    at java.net.URI$Parser.parseHierarchical(URI.java:3086)
    at java.net.URI$Parser.parse(URI.java:3034)
    at java.net.URI.<init>(URI.java:595)
    at com.google.gson.internal.bind.TypeAdapters$19.read(TypeAdapters.java:467)
    ... 64 more

我该怎么办?,提前谢谢

4

1 回答 1

0

这已添加到 jclouds JIRA。你可以在那里追踪它。 https://issues.apache.org/jira/browse/JCLOUDS-907

于 2015-05-14T18:05:18.667 回答