所以在我的POM中我有
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.5.8</version>
</dependency>
当我第一次创建我的客户时:
AmazonS3 s3 = new AmazonS3Client(Config.AWS_CREDENTIALS);
我得到了一个例外
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.amazonaws.services.s3.AmazonS3Client.<clinit>(AmazonS3Client.java:193)
at (my code)
at (glassfish trace)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 48 more
有什么想法吗?感谢
答案 0 :(得分:0)
错误表明您缺少公共日志记录依赖项,将其添加到您的maven文件中:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
这应该有所帮助。