JNI in Cloud Foundry web app

211 views
Skip to first unread message

Jay Allen

unread,
Dec 4, 2013, 10:31:32 PM12/4/13
to vcap...@cloudfoundry.org
Hey all,

We have a java web app that makes heavy use of JNI through libraries defined in LD_LIBRARY_PATH.  We can run the app locally by setting the library path in setenv.sh in Tomcat;  our first thought for Cloud Foundry was to push the entire Tomcat+web app with a modified setenv.sh as a standalone app but that doesn't appear to be possible in CF V2.  Does anyone know of a way to configure a java web app and/or CF so that java can find the native code (and the libraries can find each other through LD_LIBRARY_PATH).

Jay

James Bayer

unread,
Dec 5, 2013, 2:54:53 AM12/5/13
to vcap...@cloudfoundry.org
i think you could probably use the standalone approach of bundling tomcat with your app with the null buildpack:

and use a Procfile with contents like:
web: bin/catalina.sh

making sure to setup the env similar to the java buildpack:

if you're not familiar with buildpacks and ruby it might be a bit tough to reason about how the java buildpack works at first, but i think this would work. you'll have to make sure that the max memory settings get set with the JVM and that tomcat binds to the assigned $PORT variable too.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Thank you,

James Bayer

Jay Allen

unread,
Dec 5, 2013, 9:49:49 AM12/5/13
to vcap...@cloudfoundry.org
Hey thanks James, we'll give that a shot and let you know how we do!

Jay
Reply all
Reply to author
Forward
0 new messages