Using IBM Worklight version 6.1.0.02-20160314-1430
Implemented AES at adapter with reference to below link. https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/server-side-development/javascript-adapters/using-java-adapters/
Its working fine as expected in Eclipse in my local server. Generated war file and same given deployment for server. From server when I am trying to accessing getting below error response.
Below things are crosschecked.
Collected war file from server, crosschecked for class file and its present in that
Restart of server is taken after war file deployment
I am unable to identify where the bug is.
Error response from Server :
{
"status": 200,
"invocationContext": null,
"errorCode": "PROCEDURE_ERROR",
"errorMsg": "Procedureinvocationerror.EcmaError: TypeError: Cannotcallpropertyencryptinobject[ JavaPackagecom.winjit.EncryptionDecryption ].Itisnotafunction, itis\"object\". (API_Adapter-impl.js#7)",
"invocationResult": {
"isSuccessful": false,
"warnings": [
],
"errors": [
"Ecma Error: TypeError: Cannot call property encrypt in object [JavaPackage com.winjit.EncryptionDecryption]. It is not a function, it is \"object\". (API_Adapter-impl.js#7)"
],
"responseID": "3161",
"info": [
]
}
}
Update your JDK to 1.8
Add two Security Policy JAR files at /jre/lib/security
This error due to because of JDK mismatch of development server (Eclipse) and Server(Web sphere). Server is running on JDK 1.6. I downgraded my Eclipse's Java Version. Steps as follows(on mac).
Its working for me now as expected