我有以下代码 - 有人可以告诉我错误的原因吗?
`String provider = "openstack-nova";
String username = "admin:admin";
String credential = "luel2005";
String endpoint = "httpenter code here://192.168.2.100:5000/v2.0/";
ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider).credentials(username, credential).endpoint(endpoint);`
错误:
Exception in thread "main" java.util.ServiceConfigurationError: org.jclouds.providers.ProviderMetadata: Provider org.jclouds.aws.route53.AWSRoute53ProviderMetadata could not be instantiated: java.lang.reflect.MalformedParameterizedTypeException
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:342)
答案 0 :(得分:1)
从第一眼看,您用于创建上下文的端点似乎格式不正确:
String endpoint = "httpenter code here://192.168.2.100:5000/v2.0/";
尝试从该字符串中删除“在此处输入代码”并再试一次。有关进一步参考,请查看jcloud OpenStack QuickStart,Compute Basics示例和Rackspace Cloud Servers示例。