The APR-based Apache Tomcat Native library … was not found on the java.library.path

  INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
      The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/lib

In a hurry? TL;DR

On Dragonfly BSD, just do pkg install tomcat-native, restart Tomcat, and you’re set. You get working1) IPv6 sockets as a bonus.

-v, please

The system in question is Dragonfly BSD.

Looks like it is a simple matter of doing pkg install tomcat-native. After that, the output in catalina.out changes to a more hopeful tone:

  INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.2 using APR version 1.5.2.
  INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [true], random [true].
  INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1s  1 Mar 2016)

Lo and behold, this actually does something quite unexpected:

  % netstat -f inet6 -W -n -a | fgrep 30330
  Active Internet connections (including servers)
  Proto Recv-Q Send-Q Local Address         Foreign Address       (state)
  tcp6       0      0 *.30330               *.*                   LISTEN

Where previously only an IPv4 listener was present (which, as I have to keep repeating, is unacceptable).

This is actually very good news, and ameliorates my somewhat… sour stance about Java.2) It is 2016—I have no patience whatsoever anymore with broken software which refuses to do IPv6 in a decent manner. If this is it for Tomcat, then I’m fine. I have better things to do than fighting against software.

I still don’t like the idea of having to host Java applications3), but at least, I can do it my way now and move on to greener pasture (until I can get rid of that stuff). ◀


2) I still stand by my opinion that Java suffers particularily badly from not invented here-syndrome: Who in their right mind otherwise thinks that building your own network stack instead of using your operating system’s stack is a good idea? Java programs will stay perpetually with IP stacks stuck in the late nineties.
3) I will never understand why anyone thinks that using a 200 kB XML-file as part of the configuration (servlet.xml) is anything short of utter lunacy.
uganádarom-luun/tomcat-native-library.81.txt · Zuletzt geändert: 2016-04-17 23:01 (vor 3 Jahren) von Stefan Unterweger