You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Emir Ibrahimbegovic <ei...@gmail.com> on 2015/03/05 20:18:34 UTC

Tomcats warning message about APR library

I've got this message when starting a tomcat server :

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/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib

Even though I've installed the apr along with some other stuff like this :

sudo apt-get install zlib1g-dev build-essential libapr1 libapr1-dev
libssl-dev libreadline-dev -y

This is where I found the info that I need to install it:
http://tomcat.apache.org/native-doc/

What am I missing here? I'm using tomcat 8 btw.

Re: Tomcats warning message about APR library

Posted by Emir Ibrahimbegovic <ei...@gmail.com>.
Thanks Neven for your answer and the steps (Hvala puno!). Thanks everyone
for your answers.

@Christopher Schultz
Both their answers were more than helpful, and I learned something new. No
offense but your reply was kind of unnecessary, just because I learned
nothing new.

Thanks again guys!


On Fri, Mar 6, 2015 at 1:26 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Neven,
>
> On 3/6/15 8:13 AM, Neven Cvetkovic wrote:
> > Emir,
> >
> > The actual list of steps is at the link you mentioned earlier:
> > http://tomcat.apache.org/native-doc/
> >
> > On Fri, Mar 6, 2015 at 7:30 AM, Neven Cvetkovic
> > <ne...@gmail.com> wrote:
> >
> >>
> >> Let us know if you need help compiling the native Tomcat
> >> connectors (APR-based).
> >>
> >>
> > There might be others that want to compile their TCNATIVE
> > (apr-based) connectors, so here's the digested list below (for
> > Ubuntu/Debian based systems):
>
> Your instructions here are entirely unnecessary: the Tomcat Native
> source package includes a BUILDING.txt file that describes how to
> compile and link the library.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU+fFdAAoJEBzwKT+lPKRYNJAP/RNCLRBC/IcImFu8dyY8tmny
> OXMqkIY/KtgEo5xMUJ1kq9d687L25jGFt3t+bIAis42Bbi1ooTE3jK3U5li8W5SP
> UeFrBXCZ5HDjo4wQ0yZNebLUvWF2cBc8d/OYzCXn5kD5pu8OaNB2LcWS4XrLldvM
> yi1Qy7qjs7Skb+1uRpwBZZoBUmSJjnScer9XOWdUktt98Dtj7gzWt1AZwWsNPbeN
> ZyD0EmD+RMPHHFEgnT+lh1W/AXFbRIQrK5w36Wj1m6gGOSdS6ilmhVwQPH5G0ySM
> Gmw3pL0BWRGnCCvNxGPCsTeWG6z7FPo+u+ZqoSPQJF306n0KH8bEo/R5WUQRUAV0
> KHODvma9btr+my9hGHerhm1ZOR/oSO0dX87DBKbPSUEYPKzvREfna2tqvu45v2ZB
> SGnEvEehPDNKdPAS+zc6oGYTDN2dMS/eGj9KrmIknaogulWDRXxcDrLzCMu3w7bH
> ebAfe4REpvcqXKr5GNjacgcicxZwaQHW4J/OjVZ3BVz4rbLbp+ugPbxjHn3pOeag
> PqLnSZQaz/IX03Phvsh8XXU0oGdCcOiQlTxVGUncFYdzn3L3+Ag4Y273/B8z35hA
> A+rYxqgAnQBJDJMFgBeCR7g6mJ2tuO7Ls5NLB8j06A21v7SDEqEsgCCMvzfRCRIy
> Mn2NOA0wZAmCJMJ9/yd8
> =KuaZ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcats warning message about APR library

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Neven,

On 3/6/15 8:13 AM, Neven Cvetkovic wrote:
> Emir,
> 
> The actual list of steps is at the link you mentioned earlier: 
> http://tomcat.apache.org/native-doc/
> 
> On Fri, Mar 6, 2015 at 7:30 AM, Neven Cvetkovic
> <ne...@gmail.com> wrote:
> 
>> 
>> Let us know if you need help compiling the native Tomcat
>> connectors (APR-based).
>> 
>> 
> There might be others that want to compile their TCNATIVE
> (apr-based) connectors, so here's the digested list below (for
> Ubuntu/Debian based systems):

Your instructions here are entirely unnecessary: the Tomcat Native
source package includes a BUILDING.txt file that describes how to
compile and link the library.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU+fFdAAoJEBzwKT+lPKRYNJAP/RNCLRBC/IcImFu8dyY8tmny
OXMqkIY/KtgEo5xMUJ1kq9d687L25jGFt3t+bIAis42Bbi1ooTE3jK3U5li8W5SP
UeFrBXCZ5HDjo4wQ0yZNebLUvWF2cBc8d/OYzCXn5kD5pu8OaNB2LcWS4XrLldvM
yi1Qy7qjs7Skb+1uRpwBZZoBUmSJjnScer9XOWdUktt98Dtj7gzWt1AZwWsNPbeN
ZyD0EmD+RMPHHFEgnT+lh1W/AXFbRIQrK5w36Wj1m6gGOSdS6ilmhVwQPH5G0ySM
Gmw3pL0BWRGnCCvNxGPCsTeWG6z7FPo+u+ZqoSPQJF306n0KH8bEo/R5WUQRUAV0
KHODvma9btr+my9hGHerhm1ZOR/oSO0dX87DBKbPSUEYPKzvREfna2tqvu45v2ZB
SGnEvEehPDNKdPAS+zc6oGYTDN2dMS/eGj9KrmIknaogulWDRXxcDrLzCMu3w7bH
ebAfe4REpvcqXKr5GNjacgcicxZwaQHW4J/OjVZ3BVz4rbLbp+ugPbxjHn3pOeag
PqLnSZQaz/IX03Phvsh8XXU0oGdCcOiQlTxVGUncFYdzn3L3+Ag4Y273/B8z35hA
A+rYxqgAnQBJDJMFgBeCR7g6mJ2tuO7Ls5NLB8j06A21v7SDEqEsgCCMvzfRCRIy
Mn2NOA0wZAmCJMJ9/yd8
=KuaZ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcats warning message about APR library

Posted by Neven Cvetkovic <ne...@gmail.com>.
Emir,

The actual list of steps is at the link you mentioned earlier:
http://tomcat.apache.org/native-doc/

On Fri, Mar 6, 2015 at 7:30 AM, Neven Cvetkovic <ne...@gmail.com>
wrote:

>
> Let us know if you need help compiling the native Tomcat connectors
> (APR-based).
>
>
There might be others that want to compile their TCNATIVE (apr-based)
connectors, so here's the digested list below (for Ubuntu/Debian based
systems):

1) Install required libraries for building TCNATIVE (APR dev, APR, and SSL
tools)
sudo apt-get zlib1g-dev build-essential libapr1 libapr1-dev libssl-dev

2) Unpack TC-native source, e.g.
cd /opt/apache-tomcat-8.0.20
cd bin
tar zxvf tomcat-native.tar.gz

3) Change directory to TC-native source code, e.g.
cd /opt/tomcat/bin/tomcat-native-1.1.32-src/jni/native/

4) Prepare makefile for compiling source, e.g.
./configure --with-apr=/usr/bin/apr-config --with-prefix=/opt/tomcat

5) Compile code, e.g.
make

6) Install libraries, e.g.
make install

7) This will add libraries to:
/opt/tomcat/lib

You can see the actual things installed:
/opt/tomcat/lib/pkgconfig
/opt/tomcat/lib/pkgconfig/tcnative-1.pc
/opt/tomcat/lib/catalina-storeconfig.jar
/opt/tomcat/lib/libtcnative-1.a
/opt/tomcat/lib/libtcnative-1.so.0.1.32
/opt/tomcat/lib/libtcnative-1.so.0
/opt/tomcat/lib/libtcnative-1.la
/opt/tomcat/lib/libtcnative-1.so

8) Now we need to let Tomcat know about these libraries and add them to the
library path. Add a new file, e.g. /opt/tomcat/bin/setenv.sh file:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CATALINA_HOME}/lib

9) Restart Tomcat,e.g.
/opt/tomcat/bin/catalina.sh run

10) Observe the output, you should see something like this in the console
log:
INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
Loaded APR based Apache Tomcat Native library 1.1.32 using APR version
1.5.1.
INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
APR capabilities: IPv6 [true], sendfile [true], accept filters [false],
random [true].
NFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL
OpenSSL successfully initialized (OpenSSL 1.0.1f 6 Jan 2014)
INFO [main] org.apache.coyote.AbstractProtocol.init Initializing
ProtocolHandler ["http-apr-8080"]
INFO [main] org.apache.coyote.AbstractProtocol.init Initializing
ProtocolHandler ["ajp-apr-8009"]

Good luck!

Re: Tomcats warning message about APR library

Posted by Neven Cvetkovic <ne...@gmail.com>.
Hey Emir,

I've done a little test on my Ubuntu VM. Read below my additional comments:

On Fri, Mar 6, 2015 at 5:41 AM, Neven Cvetkovic <ne...@gmail.com>
wrote:
>
> You have two choices:
>
> 1) Find a specific package that includes the required packages, e.g.
> apt-get install libapr1 libapr1-dev
> apt-get install libtcnative-1
>
> (I have not tested these, you need to look through the packages and find
> out exactly which one you need)
>

If you decide with option (1), you could install libtcnative-1, and that
will install the following files for you:

$ dpkg --listfiles libtcnative-1
/.
/usr
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libtcnative-1
/usr/share/doc
/usr/share/doc/libtcnative-1
/usr/share/doc/libtcnative-1/copyright
/usr/share/doc/libtcnative-1/README.Debian
/usr/share/doc/libtcnative-1/changelog.Debian.gz
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/tcnative-1.pc
/usr/lib/x86_64-linux-gnu/libtcnative-1.a
/usr/lib/x86_64-linux-gnu/libtcnative-1.so.0.1.29
/usr/lib/x86_64-linux-gnu/libtcnative-1.so.0
/usr/lib/x86_64-linux-gnu/libtcnative-1.so

Notice the version number is x.1.29

After adding /usr/lib/x86_64-linux-gnu to your LD_LIBRARY_PATH, your Tomcat
will be able to find the libtcnative-1 libraries on the the library path
(java.library.path).

If you try using this package with the latest Tomcat 8.0.20 - you will run
into a problem of incompatible libraries, e.g.

SEVERE [main] org.apache.catalina.core.AprLifecycleListener.init An
incompatible version 1.1.29 of the APR based Apache Tomcat Native library
is installed, while Tomcat requires version 1.1.32

Notice the latest Tomcat 8.0.20  requires version 1.1.32.

So, the (apt-get installed) TCNATIVE shared library was found on the
library path, but it was incompatible version, and Tomcat would not start
APR-based connectors, but rather revert to default (NIO for Tomcat8, BIO
for Tomcat7).

Which brings my original point - I prefer to compile my own TCNATIVE
(APR-based) libraries to using the vendor packaged libraries (CentOS yum or
Ubuntu apt-get).

It takes time for vendor to package and distribute a new release of
packaged software, so you might be better of recompiling these pieces
yourself.

How did you install tomcat8? Did you use apt-get package or did you
> download the standard ZIP/TAR package from Tomcat's page?
>
> Good luck!
>
>
>
Let us know if you need help compiling the native Tomcat connectors
(APR-based).

Cheers!
Neven

Re: Tomcats warning message about APR library

Posted by Neven Cvetkovic <ne...@gmail.com>.
Thanks Konstantin for the clarification!

On Fri, Mar 6, 2015 at 5:41 AM, Neven Cvetkovic <ne...@gmail.com>
wrote:

>
> It's exactly what the message says - the APR shared libraries are not
> found on the java.library.path.
>
>
I stand corrected: the message notifies that (APR-based) Tomcat Native
library is not available on the java.library.path.


>
> 2) Compile your own native APR library, as the page suggested:
> http://tomcat.apache.org/native-doc/
>
>
I stand corrected: You can compile your own (APR-based) Tomcat Native
library, and for that you need APR libraries installed.

Cheers!

Re: Tomcats warning message about APR library

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-03-06 13:41 GMT+03:00 Neven Cvetkovic <ne...@gmail.com>:
> Hey Emir,
>
> On Thu, Mar 5, 2015 at 2:18 PM, Emir Ibrahimbegovic <ei...@gmail.com>
> wrote:
>
>> I've got this message when starting a tomcat server :
>>
>> 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/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
>>
>>
> It's exactly what the message says - the APR shared libraries are not found
> on the java.library.path.
>
>> Even though I've installed the apr along with some other stuff like this :
>>
>> sudo apt-get install zlib1g-dev build-essential libapr1 libapr1-dev
>> libssl-dev libreadline-dev -y
>>

The message is about Tomcat Native library.

Tomcat Native library uses APR to perform the work.  It *is not* APR.

Also,
http://tomcat.apache.org/tomcat-8.0-doc/apr.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcats warning message about APR library

Posted by Neven Cvetkovic <ne...@gmail.com>.
Hey Emir,

On Thu, Mar 5, 2015 at 2:18 PM, Emir Ibrahimbegovic <ei...@gmail.com>
wrote:

> I've got this message when starting a tomcat server :
>
> 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/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
>
>
It's exactly what the message says - the APR shared libraries are not found
on the java.library.path.




> Even though I've installed the apr along with some other stuff like this :
>
> sudo apt-get install zlib1g-dev build-essential libapr1 libapr1-dev
> libssl-dev libreadline-dev -y
>
>
You have two choices:

1) Find a specific package that includes the required packages, e.g.
apt-get install libapr1 libapr1-dev
apt-get install libtcnative-1

(I have not tested these, you need to look through the packages and find
out exactly which one you need)

2) Compile your own native APR library, as the page suggested:
http://tomcat.apache.org/native-doc/

Usually, I just compile my own on Linux (*nix, OSX), and for Windows
customers - I just use the distribution with the shared DLLs.

I prefer this way, as I deal with various Linux flavours (RHEL, CentOS,
Ubuntu) and they all have their own packages. It takes time (longer than I
want to wait) for the vendor to make these Tomcat packages. You can get
your own Tomcat installed and upgraded the very same day a new Tomcat
release is out.

Also, Tomcat team makes it very convenient for Windows users with the
Windows binaries included, and recompiling on Windows requires extra effort
setting up the tools.


> This is where I found the info that I need to install it:
> http://tomcat.apache.org/native-doc/
>
> What am I missing here? I'm using tomcat 8 btw.
>

How did you install tomcat8? Did you use apt-get package or did you
download the standard ZIP/TAR package from Tomcat's page?

Good luck!

PS. I will try locating the actual package and test it on my Ubuntu VM.