So I have this error when invoking HTTP adapter (from worklight 6.2) deployed on WebSphere Application Server v8.0.0.8 :
TypeError: Cannot call property getData in object [JavaPackage com.image.Encoder]. It is not a function, it is "object". (ImageAdapter-impl.js#3)
FWLSE0101E: Caused by: [project worklight]nullorg.mozilla.javascript.EcmaError: TypeError: Cannot call property getData in object [JavaPackage com.image.Encoder]. It is not a function, it is "object". (ImageAdapter- impl.js#3)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
...
As far as I have looked for info on the internet, it doesn't seem too complicated to deploy Java-based WL adapter. You just compile server/java package into .war classes folder and deploy it to WAS as enterprise application over update or as a new install. Does anyone have any exact guidelines how to deploy java-based adapter so it could be processed correctly?
P.S. Of course I have tried restarting server and adapter DOES work on local environment, although local is liberty server.
P.S.S. I did have same issue on local environment, but it was fixed with adding server/java folder to "Properties > Java Build Path > Source" and sometimes just adding and deleting new class. That last one just rewrites build properties probably, there are plenty of question on this issue actually, but I don't think its related to my issue.
This type of issue typically happens when there is a mismatch between the used Java versions.
Likewise in the application server (outside Eclipse), it too must use the same Java level that the project was compiled with.
Related questions: