Getting Error while connecting to AWS SQS

WM 9.8,Fix: IS Core FIX 5

On WM 9.6, Fix was IS Core Fix 11

We upgraded IS from 9.6 to 9.8. Our one of the java service which is sending a message to AWS SQS (using amazon sqs client builder) is working on WM 9.6 but after upgrade to 9.8, we are getting error for the same service. Error message “could not initialize class com.amazonaws.auth.internal.aws4signer utils”.

Do we need any jar on WM 9.8 for AWS SQS. OR any idea what could be the reason for this.

Error message “could not initialize class com.amazonaws.auth.internal.aws4signer utils”

Hi @n_b1 ,
Can you please share the list of products installed , I’m assuming that you do not have any cloudstreams adapter , and using only a java service to connect to SQS

With just IS , AWS SQS is not natively supported and you need SQS jars . For the service to work in 9.6 , the jars must have been there in the classpath
I would suggest you to check the classpath of the 9.6 installation , or the jars inside the package where the java service to connect to SQS is present.

Also you can get the full stack trace from designer → Window->Show View->Error Log

-NP

Hi @Nagendra_Prasad ,

Yes, we don’t have cloud stream adapter. It is just an IS along with MWS. But MWS has nothing to do with this functionality. So basically we developed a java service in WM to connect to AWS SQS and to send the message to SQS.

we have below jars already installed inside the package where java service is present.

Jars:

aws-android-sdk-0.2.1-debug.jar
aws-java-sdk-1.11.326.jar
aws-swf-build-tools-1.1.jar
aws_s3_authorization.jar

Are there any extra jars needed for 9.8 ?

The error "could not initialize class " indicates that the class was available in the classpath in 9.6 , but it isn’t now. A couple of things you can try

  • You can check if any of the 4 jars have this class. If not it means that there is another jar needed which contains this class, which was the case with 9.6 , perhaps it was present in the server classpath already in 9.6
  • There could be transitive dependencies as well. The full stack trace from designer → Window->Show View->Error Log should give a hint about the call stack.

-NP

The same issue with me. Attach the output you get when you click Test under Amazon SQSQueueConfiguration. This causes constant Java errors in jenkins.log, which quickly exceeds 50GB in size. I think this issue occurred after a lot of recent Jenkins and plugin updates (I’ll never do this again). I downgraded the SQS plugin to 2.0 and downgraded the AWS SDK plugin to 1.11.562. Try processing each plugin in turn, then downgrade Jenkins itself. I am using the Jenkins 2.190.3 package of Ubuntu 18.04 LTS.

Regards,
J Wick

we are not using Jenkins. We have developed a java service in IS package.
Any idea what are the jar files we need to send messages to AWS SQS using java.

Steps to fix error while connecting to AWS SQS

  • Either the SQS access policy or the AWS Identity and Access Management (IAM) policy must include permissions to explicitly allow access for the action.
  • If the SQS queue is in a different account, both the SQS access policy and the IAM policy must explicitly allow access.
    Important: An explicit deny in either policy overrides an explicit allow.
  • If the policy uses a condition element, verify whether the condition restricts access.
  • If the user or role is in an AWS Organizations organization that uses a service control policy (SCP), verify that the SCP isn’t blocking the user or role.

Regards,
Rachel Gomez

Just wanted to mention that java service to send message to AWS SQS is working on webMethods IS 9.6 version, however the same java service is not working on WM IS 9.8 version.

Below is the recent error I am getting.

Error Message:“java.lang.reflect.InvocationTargetException:com.amazonaws.util.StringUtils.trim(Ljava/lang/String;)Ljava/lang/String;”

Below jars I already placed inside a package/code/jar location
aws-android-sdk-0.2.1-debug.jar
aws-java-sdk-1.11.332.jar
aws-swf-build-tools-1.1.jar
aws_s3_authorization.jar
jackson-annotations-2.6.0.jar
jackson-core-2.6.7.jar
jackson-databind-2.6.7.1.jar
jackson-dataformat-cbor-2.6.7.jar

Is this error related to jar ? Do we need to get some other jar for this ?

Hi,

you should check if you have the correct versions of these jars.
Are they different between wM 9.6 and wM 9.8?

You can introspect the jars with any zip-compatible tool to find out which one has the class com.amazonaws.util.StringUtils included.

Regards,
Holger

1 Like

Hi @n_b1

From the list of the jars, it looks like the difference could be between aws-java-sdk-1.11.326.jar and aws-java-sdk-1.11.332.jar , you can check the version 326 jar to check if the file com/amazonaws/util/StringUtils.class exists.
If this doesn’t help you could enable verbose logs for classloading in 9.6 and check the wrapper logs.

Classes/packages can be restructured in later versions ( for reasons of coherence or reuse etc.,) , I’m guessing this class was moved out of the jar and into another one, the release notes of a jar usually have these details.

-NP

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.