Wowza Community

AWS SDK S3 client InvocationTargetException

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

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…

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));

I think this is basically a duplicate

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

I think this is basically a duplicate

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.