Amazon SNS - Error and Solution

Errors :
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.auth.internal.AWS4SignerUtils
at com.amazonaws.auth.internal.AWS4SignerRequestParams.(AWS4SignerRequestParams.java:86)
at com.amazonaws.auth.AWS4Signer.sign(AWS4Signer.java:187)

Or any error related to timestamp…

Symptoms :
You will see the code getting compiled in eclipse and it will execute as well.
When same code is written in JavaService ,it gets compiled but works in windows and when same package is deployed to linux it wont work.
When the code is written in JavaService ,it gets compiled but it wont run .
All these scenarios happen though you keep all required jars in required places…
For some reasons you need to explicitly give this particular jar in IS PREPEND classes…

For earlier versions of IS , the file should setenv.bat/sh

Solution:

–>Stop the IS
–>Add joda-time-2.3.jar to the PREPEND classes path
i.e in 9.7 it should be added in custom_wrapper.conf file
wrapper.java.additional.202=-Dwatt.server.prepend.classes=C:\SoftwareAG97\common\lib\wm-converters.jar;C:\SoftwareAG97\IntegrationServer\instances\default\packages\CloudStreamsPOC\code\jars\joda-time-2.3.jar
–>Start the IS

Suresh,
I had faced the similar error while working with SNS java service. The simple solution would be to

Add the joda-time-2.3.jar to the package\code\jars and Update the manifest file to look for the jar files within the package\jars

It was an easy fix for me.

Yes, either ways … we need to explicitly tell IS for classloading of this jar to happen

package

Thanks both for your fix.