[英]Error calling to the cloud jclouds
So I am trying to download files on a rackspace server to my local server. 因此,我试图将机架服务器上的文件下载到本地服务器。 It is laid out here . 它布置在这里 。 For some odd reason, I am trying to make the initial call to the cloud and it is giving me some serious feedback. 出于某种奇怪的原因,我正在尝试向云进行初始调用,这给了我一些严肃的反馈。 No idea where to go from here. 不知道从这里去哪里。 I've tried all sorts of different Maven dependencies to fix the problem, but none have come close. 我已经尝试了各种不同的Maven依赖关系来解决此问题,但没有一个接近。 Am I overlooking something? 我在俯视什么吗? TIA! TIA!
My code: 我的代码:
public static void main (String[] args){
CloudFilesApi cloudFilesApi = ContextBuilder.newBuilder(PROVIDER)
.credentials(USERNAME, KEY)
.buildApi(CloudFilesApi.class);
}
And here are my errors (without Guice): 这是我的错误(没有Guice):
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.jclouds.ContextBuilder.<clinit>(ContextBuilder.java:151)
at com.unidev.download.Main.main(Main.java:10)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 2 more
Here are my dependencies (now): 这是我的依赖项(现在):
<dependencies>
<!-- Rackspace US dependencies -->
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
<artifactId>rackspace-cloudfiles-us</artifactId>
<version>${jclouds.version}</version>
</dependency>
Code snippet for dependency tree(updated): https://codeshare.io/bfbKg 依赖关系树的代码片段(更新): https : //codeshare.io/bfbKg
I guess it is a Maven issue... When I was building the Maven project and using the dependencies via the pom file, it was somehow building incorrectly. 我想这是一个Maven问题...当我构建Maven项目并通过pom文件使用依赖项时,它以某种方式错误地构建。 Instead, I started a Java file and built a lib folder, pulled all the jars I needed and then just tied them in via the build path... and it is working well now... 相反,我启动了一个Java文件并建立了一个lib文件夹,拉出了我需要的所有jar,然后通过构建路径将它们捆绑在一起...现在运行良好...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.