0
votes
This is the format I have used for API accesskey and secret key in AwsCredentials.properties
    # Fill in your AWS Access Key ID and Secret Access Key
    # http://aws.amazon.com/security-credentials
    accessKey = accessKeyHere
    secretKey = secretKeyHere

I got this exception when I tried to compile the code. I have already installed the toolkit for eclips and I am using eclipse kepler

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at com.amazonaws.AmazonWebServiceClient.(AmazonWebServiceClient.java:56) at test_toolkit.GetS3Object.main(GetS3Object.java:19) 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)

I have tried many methods, also by adding commons-logging-1.1.3 jar then it gives httpclient exception , I searched a lot and then also added this jar httpcomponents-client-4.3.3 but nothing worked for me. Can some one please guide me that how I can start an EC2 instance from my local system and then I want to attach an EBS volume to it. Thanks

2

2 Answers

0
votes

If you've only copied jackson core and jackson databind, you need jackson annotations to use the ObjectMapper.

For example, make sure you have something like this:

        [16:32:01]:/android-project/libs     master]$ ls -lAF
    total 2112
-rw-r--r--@ 1 jeffamaphone  staff   33525 Jun 18 16:06 jackson-annotations-2.0.2.jar
-rw-r--r--@ 1 jeffamaphone  staff  193693 Jun  7 16:42 jackson-core-2.0.2.jar
-rw-r--r--@ 1 jeffamaphone  staff  847121 Jun 18 15:22 jackson-databind-2.0.2.jar

Hope so this resolve your headache.

0
votes

Actually nothing has gone wrong with the code, Since you didn't posted the code but still I want to share a tip with you : -

Please check the class name and the file name, both should be same.

Exception in thread "main" java.lang.NoClassDefFoundError

This type of error appears due to mismatch of Class name and File name.