0

I'm running apache tomcat on a Linux machine hosted on google cloud, standard machine without anything fancy.

The machine host's back_end Java API business application which requires certain binary .so files to link to when running.

The required libraries are added to $LD_LIBRARRY_PATH

But when i run tomcat, java.library.path does not include this, and i get the error:

31-May-2022 11:20:16.378 INFO [main] jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib/x86_64-li nux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]

Im out of ideas, how do i setjava.library.path includes $LD_LIBRARY_PATH when java runs ?

Krgds.

MORE INFO:

running from commandline:

java -XshowSettings:properties

gives:

  java.library.path = $LD_LIBRARY_PATH
    /opt/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux
    /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib
    /usr/java/packages/lib
    /usr/lib/x86_64-linux-gnu/jni
    /lib/x86_64-linux-gnu
    /usr/lib/x86_64-linux-gnu
    /usr/lib/jni
    /lib
    /usr/lib

But when tomcat/catalina, runs it tels:

was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib/x86_64-li
nux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Krayer
  • 31
  • 5
  • 1
    I think `java.library.path` is sometimes not set, so why not included it explicitly in your OPTS? `-Djava.library.path=$LD_LIBRARY_PATH:/your/extra/libraries` – g00se May 31 '22 at 11:37
  • I wonder if you only set it without `export`? – Maarten Bodewes May 31 '22 at 11:40
  • Thanks! @g00se: could be, where ? In catalina.sh ? – Krayer May 31 '22 at 11:44
  • Could be TOMCAT_OPTS but check for your version, as Tomcat has the habit of changing all the time – g00se May 31 '22 at 11:45
  • Like: JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH" ?? – Krayer May 31 '22 at 11:46
  • JAVA_OPTS could still be a thing, but as I said, check for your version – g00se May 31 '22 at 11:51
  • I'm using /opt/apache-tomee-plus-9.0.0-M3 , so as i understand it's CATALINA_OPTS, but not sure how to add it... when i run: java -XshowSettings:properties from commandline, eveything looks fine, and the paths are included, But when is start Catalina, it's not considered, it seems to default and exclude my libs ? – Krayer May 31 '22 at 12:43
  • *eveything looks fine* Can you post that output in code tags please? (JUst the bit that includes `java.library.path`) – g00se Jun 01 '22 at 10:08
  • Yes! I have added the output, at the end of original question, above – Krayer Jun 01 '22 at 10:57

0 Answers0