0
votes

I am using the following code from AWS documentation:

http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpJava.html

And i have used the following jars : Jars used

And i am getting the following error :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at com.amazonaws.AmazonWebServiceClient.(AmazonWebServiceClient.java:58) at UploadObject.main(UploadObject.java:17) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more

Any help would be appreciated for the same. I have tried adding the common logging jars but no luck.

1

1 Answers

0
votes

Hi there are quite a few third-party library's required for AWS to work. The ones below are the extras packaged with the SDK download. I seem to remember there being one missing though so let me know if this doesn't work and i'll check my dependencys.

All of these can be found in '\aws-java-sdk-1.9.1\third-party'

aspectj-1.6

commons-codec-1.6

commons-logging-1.1.3

freemarker-2.3.1.8

httpcomponents-client-4.3

jackson-annotations-2.3.0

jackson-core-2.3.2

jackson-databind-2.3.2

javax-mail-1.4.6

joda-time-2.2

spring-3.0