aws java sdk

For © 2019 Apigee Corp. All rights reserved. Version 4.17.01.01 using latest aws java sdk, related to the following javacallout code block:

AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); 
AmazonS3 s3 = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).build();     
s3.createBucket(bucketName); }

error is received on runtime:

error com/amazonaws/services/s3/AmazonS3ClientBuilder
error.cause com.amazonaws.services.s3.AmazonS3ClientBuilder
error.class java.lang.NoClassDefFoundError

pom.xml

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.487</version>
</dependency>

Has anybody done an integration similar to this or can we please receive a confirmation for supported version of amazon?

Thanks,

Slobodanka

Solved Solved
0 2 1,919
1 ACCEPTED SOLUTION

java.lang.NoClassDefFoundError suggests that there is a dependency missing at runtime.

You showed your pom.xml file, and that is used at compile time I suppose, to build your java callout.

What about the runtime dependencies?

The runtime dependencies for the callout JAR that you are building need to be available to Apigee Edge at runtime. Have you ensured that the dependent jars are available? Can you list the jars (java resources) that are available for the proxy and environment?

can we please receive a confirmation for supported version of amazon?

No, there is no such statement from Apigee on "the supported version of the Amazon AWS SDK". We don't test for compatibility with the AWS SDK, and we don't make guarantees of support for the AWS SDK. You can try it; it may work.

The problem you are experiencing is not related to compatibility. It seems to be due to a missing dependency.

View solution in original post

2 REPLIES 2

java.lang.NoClassDefFoundError suggests that there is a dependency missing at runtime.

You showed your pom.xml file, and that is used at compile time I suppose, to build your java callout.

What about the runtime dependencies?

The runtime dependencies for the callout JAR that you are building need to be available to Apigee Edge at runtime. Have you ensured that the dependent jars are available? Can you list the jars (java resources) that are available for the proxy and environment?

can we please receive a confirmation for supported version of amazon?

No, there is no such statement from Apigee on "the supported version of the Amazon AWS SDK". We don't test for compatibility with the AWS SDK, and we don't make guarantees of support for the AWS SDK. You can try it; it may work.

The problem you are experiencing is not related to compatibility. It seems to be due to a missing dependency.

Thank you.

Missing were:

  • aws-java-sdk-core
  • aws-java-sdk-s3
  • httpclient
  • httpcore

Slobodanka