GAE - Standard Env - java.lang.UnsatisfiedLinkError even after specifying java.library.path

95 views
Skip to first unread message

Praveenkumar Venkatesan

unread,
Aug 4, 2020, 3:56:42 AM8/4/20
to Google App Engine
I'm trying to use opencv in my app. opencv has native libraries that need to be loaded.
I have set java.library.path in order to load them using System.loadLibrary. So the app picks up the library i want to load from the java.library.path specified but the native library has internal dependencies and they are not getting picked.

java.library.path is set to /tmp/dependencies

Error from the logs:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/dependencies/libopencv_java440.so: libopencv_ml.so.4.4: cannot open shared object file: No such file or directory 

libopencv_ml is present under /tmp/dependencies. even tho java.library.path is specified, its not picking it up. I think I need to set LD_LIBRARY_PATH but not sure if I can do this in the standard environment.

Is this something GAE supports? Can I load native libraries in GAE?

Thanks,
Praveen



Praveenkumar Venkatesan

unread,
Aug 4, 2020, 8:04:40 AM8/4/20
to Google App Engine
i was able to resolve this issue by running in the flex env.

Katayoon (Cloud Platform Support)

unread,
Aug 4, 2020, 9:13:35 AM8/4/20
to Google App Engine
Hi Praveenkumar,

Happy to hear that the issue is resolved. As you clearly denoted and explained in this documentation, using the standard environment, your application runs inside of a sandbox. Hence, your application can not write to disk or use non-whitelisted binary libraries.

Reply all
Reply to author
Forward
0 new messages