# AWS SDK S3 client InvocationTargetException

**URL:** <https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 14, 2014, 2:38am UTC](https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027 "2014-05-14T02:38:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malcolm\_Christie](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Malcolm\_Christie](https://community.wowza.com/u/Malcolm_Christie)\
**Post date:** [May 14, 2014, 2:38am UTC](https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027/1 "2014-05-14T02:38:22Z")

</div>

I have a plugin which is being activated correctly, but I’m having issues implementing the AWS SDK to upload the file to S3, I’m pretty new to Java so I’m not really sure what this error could be an indication of, as far as I can tell my code is all correct…

The exact error

```auto
java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:483)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:48)

```

My code…

```auto
String bucketName = "m***";
String myAccessKeyID = "AKI *******";
String mySecretKey = "K6n ****";
String keyName = "recorded/"+fileName;
 
BasicAWSCredentials myCredentials = new BasicAWSCredentials(myAccessKeyID, mySecretKey);
 
getLogger().info("Passed credentials"); // Logs ok
 
// This line is where it breaks
AmazonS3 s3client = new AmazonS3Client(myCredentials);
 
getLogger().info("Passed client"); // Never reaches here
s3client.putObject(new PutObjectRequest(bucketName, keyName, file));

```

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 16, 2014, 9:43pm UTC](https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027/2 "2014-05-16T21:43:26Z")

</div>

I think this is basically a [duplicate](http://community.wowza.com/t/-/43025)

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 11, 2014, 4:15pm UTC](https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027/3 "2014-06-11T16:15:29Z")

</div>

Thanks. Interesting. I am working with that SDK myself, just getting started. I have the S3Sample integrated into a Wowza module with latest SDK, no build errors so far. Working local too.

Thanks for the info,

Richard

---

<div class="post-metadata">

**Author:** ![chris\_williams](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@chris\_williams](https://community.wowza.com/u/chris_williams)\
**Post date:** [June 11, 2014, 4:07pm UTC](https://community.wowza.com/t/aws-sdk-s3-client-invocationtargetexception/43027/4 "2014-06-11T16:07:09Z")

</div>

> I think this is basically a [duplicate](http://community.wowza.com/t/-/43025)

Hi,

I’ve run into the same thing myself. The same code works on the AWS Java SDK 1.5.8, but doesn’t ( however should ) with 1.6.12 and 1.7.12 ( the latest ). I’ve also tested using the 1.3.x SDK, and works fine.

This is all with Wowza Streaming Engine 4.0.3.01 and 4.0.3.03, and connecting to DynamoDB rather than S3, and on Sun Java 1.8.0\_05.

We noticed this when we ported custom modules to Wowza 4 (and they worked) and upgraded the AWS SDK which then caused all kind of problems.

Hope this helps.

#Edit: Referring to the post you mention above, my testing is on a local development machine rather than on the EC2 instance itself, using fixed user credentials.
